Get Variables in CMMN Task

I want to get access to a Variable after the CMMN Task is finished.
I have a case execution Listener for the “complete” Event type.
There i want to use a Inline Script (JavaScript)

I have first tried this line of script:

var typedDocument = execution.getVariableTyped('document');

But it failed with the error:

ReferenceError: "execution" is not defined in <eval> at line number 1

Then i changed the Script to:

var typedDocument = task.execution.getVariableTyped('document');

But this give me the error:

ReferenceError: "task" is not defined in <eval> at line number 1

And if i changed it to:

var typedDocument = case.execution.getVariableTyped('document');

The Error is this:

Expected an operand but found case
var typedDocument = case.execution.getVariableTyped('document');

How do i access the Variables?

Hi,

replace execution with caseExecution… See [1] for more detail.

regards

Rob

[1] https://docs.camunda.org/manual/7.8/user-guide/process-engine/expression-language/#internal-context-variables

1 Like