If a DMN input expression does not exist as variable of the process instance - I get an exception.
It works fine, if I check this in a JavaScript-task before the DMN and generate a needed variable if it does not exist.
But can I do this directly in the DMN ?
The following JavaScript works as JavaScript-Task but not here as JavaScript Expression for the DMN input:
execution.setVariable(‘DriverCode’,(execution.hasVariable(“DriverCode”) ? execution.getVariable(“DriverCode”) : “”))
=> Result is an Exception:
org.camunda.bpm.dmn.engine.impl.DmnEvaluationException: DMN-01002 Unable to evaluate expression for language ‘ECMAScript’: ‘execution.setVariable(‘DriverCode’,(execution.hasVariable(“DriverCode”) ? execution.getVariable(“DriverCode”) : “”))’
or what is the best way to prove if the input variable exists to avoid an exception in the DMN ?