Unit test DMN JUEL Cannot resolve identifier 'execution'

Hi there,
I recently changed my code from using process variables as DMN input to JUEL-expressions. This works just fine in practice but it broke my unit tests with following exception:

org.camunda.bpm.dmn.engine.impl.DmnEvaluationException: DMN-01002 Unable to evaluate expression for language 'JUEL': '${orderDecisionTask.getInputData(execution).status}'
(...)
Caused by: org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'execution'
(...)

The unit test works fine if I don’t use execution as a parameter but I need it to cache the input per execution. Is there anything I need to configure to make the unit test work?

I created a simple example from the template:orderDecision.dmn (3.0 KB)

Hi @wolframS,

the execution object is instantiated by the process engine.

You can write a Unit test deploying the process and the decsion table and start the process directly before the business rule task: https://docs.camunda.org/manual/7.12/user-guide/process-engine/process-instance-modification/#process-instance-modification-in-junit-tests

Hope this helps, Ingo

Hi @Ingo_Richtsmeier,

thank you for your answer. Sorry that it wasn’t clear in my question but I already wrote a unit test for the whole process based on the camunda-engine-unittest template. Here is the BPMN: testProcess.bpmn (2.6 KB)

I could upload the whole project later (probably best to github?) if this is necessary to make things clear

Here is my project based on the camunda-engine-unittest:

I hope this helps to make my problem understandable