Cmmn variable event listener does not works

Hi,

I’m setting up a cmmn with:

  • An auto-userTask, with a taskListener to set variable ‘assignee’ whenever an assign-task event is captured.
  • A variableEventListener which listens to all-change-type of the variable ‘assignee’ which will then trigger a processTask.

Step 1 works fine and I can see my variable ‘assignee’ visible in my cmmn instance, but the variableEventListener is never being triggered.
If I changed the variableEventListener to listen to an execution variable instead, it’ll be triggered; One difference that I noticed for these 2 cmmn instance is that the one that listens to a taskVariable will have a Event subscriptions created.

What’s going wrong? Or if there’s any way to capture a task-reassigned-event so that I can fire up a processTask?

Hey @tifanny,

Instead of doing task.setVariable, I’ll suggest to you to use the CmmnTaskService#setVariable(task.id, 'assigneeVar', task.assignee);, then I believe that the variable event listener will be invoked. Currently, it is not being invoked as your are not using the public API to set the variable.

Cheers,
Filip