Description of problem: When a ProcessEventListener is added to session, it reports events in a wrong order. Version-Release number of selected component (if applicable): BRMS-5.3.0-ER4 How reproducible: Every time Steps to Reproduce: 1. add ProcessEventListener 2. start simple process Actual results: beforeProcessStarted beforeNodeTriggered beforeNodeLeft beforeNodeTriggered beforeVariableChanged afterVariableChanged beforeNodeLeft beforeNodeTriggered beforeNodeLeft beforeNodeTriggered afterNodeTriggered afterNodeLeft beforeNodeLeft beforeNodeTriggered afterNodeTriggered afterNodeLeft afterNodeTriggered afterNodeLeft afterNodeTriggered afterNodeLeft afterNodeTriggered afterProcessStarted Expected results: beforeProcessStarted afterProcessStarted ... the rest of the events Additional info: pull request on the way (test case will probably be added to already opened request #52)
test case added to pull request #52
This is actually expected behavior. Before and after events are used to derive what events are triggered as the result of the first. It might make more sense if you visualize it as a tree: - beforeProcessStarted - beforeNodeTriggered - beforeNodeLeft - beforeNodeTriggered - beforeVariableChanged afterVariableChanged - beforeNodeLeft - beforeNodeTriggered - beforeNodeLeft - beforeNodeTriggered afterNodeTriggered afterNodeLeft - beforeNodeLeft beforeNodeTriggered afterNodeTriggered afterNodeLeft afterNodeTriggered afterNodeLeft afterNodeTriggered afterNodeLeft afterNodeTriggered afterProcessStarted So in this case, the starting of the process triggers the the next node, which is the left, etc. But all events in between the beforeProcessStarted and afterProcessStarted occurred as a result of the startProcess(..) invocation, and are therefore logged in between. Does this make sense?
(In reply to comment #4) > Does this make sense? Unfortunately no, it doesn't. In our opinion, this goes directly against what you as a user expect of these events. Before* works very well, but the After* are just plain wrong - you don't want to get AfterProcessStarted at the end of your process - you want to get it immediately after the process starts. Otherwise "AfterProcessStarted" is actually "BeforeProcessEnded". This is a very important distinction for the semantics of the events. QE is of the opinion that After* events that a) don't arrive immediately after the situation happens, AND b) don't even happen in the same order are useless and harmful.
Updated in community docs: https://github.com/droolsjbpm/jbpm/commit/89bca815b8efc026dae51cd52afc0077a4f0eb71
Update status to ON_QA. Please verify them against ER6.
The bug is documented therefore I'm marking it verified.
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.