Encounter an error when using a standard java string method (startsWith) with JEUL expression:
${javaString.startsWith("somePrefix")}.
The above expression is used in two different DMN(s), both within the same BPMN. The first DMN has no issue at all when calling the above input JEUL expression. However, when the second DMN called the same JUEL expression. It resulted in the following error message:
2020-04-17 17:26:02,998 [JUnit-ForkJoinPool-1-worker-1] ERROR org.camunda.bpm.engine.context --- ENGINE-16004 Exception while closing command context: DMN-01002 Unable to evaluate expression for language 'juel': '${JavaString.startsWith("somePrefix")}'
org.camunda.bpm.dmn.engine.impl.DmnEvaluationException: DMN-01002 Unable to evaluate expression for language 'juel': '${JavaString.startsWith("somePrefix")}'
at org.camunda.bpm.dmn.engine.impl.DmnEngineLogger.unableToEvaluateExpression(DmnEngineLogger.java:35)
at org.camunda.bpm.dmn.engine.impl.evaluation.ExpressionEvaluationHandler.evaluateElExpression(ExpressionEvaluationHandler.java:121)
....
some more stack trace
....
Caused by: org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException: Target unreachable, base expression *'. JavaString'* resolved to null
at org.camunda.bpm.engine.impl.juel.AstMethod.invoke(AstMethod.java:81)
at org.camunda.bpm.engine.impl.juel.AstMethod.eval(AstMethod.java:75)
At first, it looks like the setting of the DMN of an input variable, I couldn’t find anything abnormal and it doesn’t explain why the same expression worked in the first DMN. I look into several posts about PropertyNotFoundException and I have checked and sure the string pass in is not null and not empty.
Also interestingly, the second DMN actually passing unit testing when the variable is passed into DMN from a CSV file.
If you have any idea what may be causing the error, I greatly appreciate your help!