-
Enhancement
-
Resolution: Done
-
Major
-
None
-
7.4, 7.6
-
2020 Week 07-09 (from Feb 10), 2020 Week 10-12 (from Mar 2), 2020 Week 13-15 (from Mar 23), 2020 Week 16-18 (from Apr 13)
-
6
-
Documentation (Ref Guide, User Guide, etc.)
-
+
The order in which the JBPM engine fires events - allowing ProcessEventListener implementations to act upon catching these - is poorly documented, and perhaps counter-intuitive. We need a concise and clear description of this event ordering.
Running 2 simple processes (straight-through & human task) it would seem that before* and after* events occur pairwise around safe points, with corresponding after* events in the exact opposite order of their before* counterparts.
Another way of describing this might be: before* events are fired and put on a stack until a safe point is reached, then corresponding after* events are fired by emptying the stack.
In the case of straight-through processes, this leads to an ordering where the afterProcessStarted event occurs after its corresponding afterProcessCompleted event. Whilst not incorrect, this can be confusing. A developer might assume they may delete a process instance id in the latter handler since they expected this id to have been persisted in the former - as demonstrated by the linked support case.