Activiti/Activiti — pull request #476 by DavidValeri (2014-12-15 21:35:02+00:00)
Title: [ACT-2171] NPE, integrity constraint violation, and timers firing after task completion on processes with certain combinations of timers, messages, and user tasks

This PR addresses two initial issues found with the workflow used in the included test case; however, it leaves one remaining issue unresolved.

The underlying issue manifests at `org.activiti.engine.test.bpmn.event.message.MessageBoundaryEventTest` line 600 when the "task" user task is completed after having had a boundary event trigger earlier in the test. When the non-interrupting boundary event fires, the existing execution for the "task" user task is turned into a concurrent execution by `org.activiti.engine.impl.bpmn.behavior.BoundaryEventActivityBehavior.execute(ActivityExecution)`. When the "task" user task is later completed on line 600 of the test, the thread of execution eventually ends up in `org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(InterpretableExecution)` on line 91 where the existing execution is propagated on to the next activity in the process without destroying existing jobs.

I have not had time to examine possible solutions at this point that do not introduce regressions. If you have pointers or know the path forward, please let me know so I can help to get this pull request into the mainline as soon as possible.