Strange Behavior! .Task Listener getting executed twice

hi All,

I am triggering an event sub processes from Task Listener (I want those sub processes to be executed only once. The reason why I used task listener is that I want to pass task Id to the sub process.) . However the task listeners/sub processes are getting executed twice. ie. Add work trace / Create task sub processes are executed at time of creation of the user task as well as upon approval of the user tasks.

  • I have used task.processEngineServices.runtimeService.setVariable () to trigger the sub process. Because
    task.execution.setVariable() is not triggering the event sub process.

Attached are the bpmn workflow file and post man curl to trigger that workflow. Please help me.

workflow.bpmn (21.2 KB)

postman-curl.txt (485 Bytes)

I have simplified the workflow diagram. Still the sub process is getting executed multiple times even though I triggered it only once. Could anyone please help me out.

workflow.bpmn (8.2 KB)

postman-curl.txt (485 Bytes)

Hello @prasadps,
If you use Camunda Tasklist with the generic TaskForm and load all variables it will execute an update to each variable which triggers the conditional start event.
You need to change the Variable Event on the conditional start event to listen only for create OR you must suppress the update by providing your own html with the taskDetails variable in readonly mode.

Best, McAlm


Thanks @McAlm !!! It worked :blush:. …This was quiet confusing …had to spend the whole day behind this.