Send variables when activating task


We’re modeling a use case using CMMN where some actions need to be triggered manually.

Basically, the user is allowed to make requests which someone else will respond later. It doesn’t make much sense for us that the filling of the request is viewed as a user task because it will confuse people when they see two tasks for just one request (one for filling the request and the other for answering it).

We’ve tried two different things:

  1. Using an event listener.

  2. Using manual activation rule

The first one looks like the most appropriate because you can label things right.
Nonetheless, it doesn’t seem to be possible to send variables when triggering the event listener (using cmmnEngine.getCmmnRuntimeService().completeUserEventListenerInstance()) or when trigerring the manual user task (using cmmnEngine.getCmmnRuntimeService().startPlanItemInstance()).

Is this something possible to do? How would you model/implement this type of behavior?

Thank you,

1 Like

Use the CmmnRuntimeService#createPlanItemInstanceTransitionBuilder, This one has methods to pass in variables.