Deploy a process with a parallel multi instance sub process. This sub process contains a task with a execution-end-listener:
Start an instance of the process, so that there are two tasks: receiveTask1 and receiveTask2. And there are two threads t1 and t2. t1 correlates a message against receiveTask1 and t2 correlates a message against receiveTask2 in parallel.
1) Both threads t1 and t2 fetch the current execution tree.
2) t1 signals receiveTask1 -> execution-end-listener is invoked
3) t2 signals receiveTask2 -> execution-end-listener is invoked
4) t1 executes end event inside parallel multi instance sub process
5) t2 executes end event inside parallel multi instance sub process
6) t1 calls ParallelMultiInstanceActivityBehavior#concurrentChildExecutionEnded()
– the variable nrOfActiveInstances is set to 1
7) t1 flushes and commits its changes
8) t2 calls ParallelMultiInstanceActivityBehavior#concurrentChildExecutionEnded()
– fetch the variable nrOfActiveInstances (value is 1)
– decrement nrOfActiveInstances (value is 0)
– for each concurrent child execution deleteCascade is invoked -> execution-end-listener of receiveTask1 is invoked
The execution-end-listener of receiveTask1 is not invoked in step 8.