Pass the execution to a ServiceTask (CMMN)

Hello,

The documentation states you can inject the execution as parameter of a ServiceTask: BPMN 2.0 Constructs · Flowable Open Source Documentation

<serviceTask id="javaService"
         name="My Java Service Task"
         flowable:expression="#{printer.printMessage(execution, myVar)}" />

It works well for BPMN but when it comes to CMMN, it throws an exception:

Cannot resolve identifier ‘execution’

Any idea how to inject the execution in CMMN?

Note: I prefer to use method on bean rather than implementing JavaDelegate because you can pass argument without using an intermediary variable

Thank you
Regards

1 Like

CMMN does not have an execution. However, you can inject planItemInstance or caseInstance into it.

That’s possible, e.g. use DelegatePlanItemInstance as parameter.

It works :wink:

Thank you for your answer.