There is a message in the log:
Engine created. [value-mapper: org.camunda.feel.integration.CamundaValueMapper@6bfbd70f, function-provider: com.a.b.c.config.camunda.CustomJavaFunctionProvider@6ca64178]
This is my DmnEngine: @Bean
public DmnEngine dmnEngine() {
DefaultDmnEngineConfiguration dmnEngineConfig = (DefaultDmnEngineConfiguration) DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
dmnEngineConfig.setFeelEngineFactory(new CamundaFeelEngineFactory());
dmnEngineConfig.setDefaultOutputEntryExpressionLanguage(“feel”);
return dmnEngineConfig.buildEngine();
}
If I try to evaluate a table with my function, there is an error:
org.camunda.bpm.dmn.feel.impl.FeelException: failed to evaluate expression ‘decr(3)’: no function found with name ‘decr’ and 1 parameters
Can anyone help please?
It uses my CustomJavaFunctionProvider because of
Engine created. [value-mapper: org.camunda.feel.integration.CamundaValueMapper@18b349bc, function-provider: com.a.b.c.config.camunda.CustomJavaFunctionProvider@24015985]
I did as you mentioned, and I have created a new class CamundaFeelEngineFactory:
package io.zeebe.dmn;
import org.camunda.bpm.dmn.feel.impl.FeelEngine;
import org.camunda.bpm.dmn.feel.impl.FeelEngineFactory;
import org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl;
public class CamundaFeelEngineFactory implements FeelEngineFactory {
@Override
public FeelEngine createInstance() {
FeelEngineFactoryImpl factoryImpl = new FeelEngineFactoryImpl();
return factoryImpl.createInstance();
}
}
Afterwards, I ran mvn clean install of the Zeebe DMN Worker and the tests seem to fail:
2021-05-05 10:03:53.387 INFO 13376 --- [ main] io.zeebe.dmn.WorkflowTest : Started WorkflowTest in 4.813 seconds (JVM running for 37.999)
2021-05-05 10:03:54.590 INFO 13376 --- [ault-executor-0] io.zeebe.client.job.poller : Activated 1 jobs for worker camunda-dmn-worker and job type DMN
2021-05-05 10:03:54.641 WARN 13376 --- [pool-6-thread-1] io.zeebe.client.job.worker : Worker camunda-dmn-worker failed to handle job with key 2251799813685258 of type DMN, sending fail command to broker
java.lang.UnsupportedOperationException: FEEL-01016 Simple Expression not supported by FEEL engine
at org.camunda.bpm.dmn.feel.impl.juel.FeelEngineLogger.simpleExpressionNotSupported(FeelEngineLogger.java:160) ~[camunda-engine-feel-juel-7.14.0.jar:7.14.0]
at org.camunda.bpm.dmn.feel.impl.juel.FeelEngineImpl.evaluateSimpleExpression(FeelEngineImpl.java:48) ~[camunda-engine-feel-juel-7.14.0.jar:7.14.0]
at org.camunda.bpm.dmn.engine.impl.evaluation.ExpressionEvaluationHandler.evaluateFeelSimpleExpression(ExpressionEvaluationHandler.java:130) ~[camunda-engine-dmn-7.14.0.jar:7.14.0]
at org.camunda.bpm.dmn.engine.impl.evaluation.ExpressionEvaluationHandler.evaluateExpression(ExpressionEvaluationHandler.java:59) ~[camunda-engine-dmn-7.14.0.jar:7.14.0]
at org.camunda.bpm.dmn.engine.impl.evaluation.DecisionTableEvaluationHandler.evaluateInputExpression(DecisionTableEvaluationHandler.java:193) ~[camunda-engine-dmn-7.14.0.jar:7.14.0]
at org.camunda.bpm.dmn.engine.impl.evaluation.DecisionTableEvaluationHandler.evaluateInput(DecisionTableEvaluationHandler.java:122) ~[camunda-engine-dmn-7.14.0.jar:7.14.0]
at org.camunda.bpm.dmn.engine.impl.evaluation.DecisionTableEvaluationHandler.evaluateDecisionTable(DecisionTableEvaluationHandler.java:104) ~[camunda-engine-dmn-7.14.0.jar:7.14.0]
at org.camunda.bpm.dmn.engine.impl.evaluation.DecisionTableEvaluationHandler.evaluate(DecisionTableEvaluationHandler.java:81) ~[camunda-engine-dmn-7.14.0.jar:7.14.0]
Would you have any suggestions regarding this error ?
UPDATE:
I did a mvn clean install -DskipTests, and I still get the error no function found with name 'decr' and 1 parameters
@y-io in the AppConfig.java of zeebe-dmn-worker this did the trick:
DefaultDmnEngineConfiguration config =
(DefaultDmnEngineConfiguration)
DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
config.setDefaultOutputEntryExpressionLanguage(“feel-scala”);