We are explicitly sending out before and after events to make sure you
can figure out which events are the result of what other events. This
allows us to recreate a tree-view of events (e.g. see the audit logger).
The order you are seeing is normal, let me try to explain.
If you have a sequence of 2 nodes, the events generated by this will be:
Since execution is synchronous (unless you are using async nodes), this
means that the after event will only occur once the thread of control
returns back to that node, so after all following sync nodes have been
You can get your expected behaviour by logging on beforeNodeTriggered
Quoting Carlos Villegas <cav(a)uniscope.jp>:
I'm testing the ProcessEventListener on a simple process and I get
"after" events in reverse order.
Process completed : 1283915643204
Node left: 5: 1283915643268
Node triggered: 5: 1283915643268
Node left: 4: 1283915643268
Node triggered: 4: 1283915643269
Node left: 3: 1283915643269
Node triggered: 3: 1283915643270
Node left: 2: 1283915643270
Node triggered: 2: 1283915643270
Node left: 1: 1283915643270
Node triggered: 1: 1283915643271
Node left: 0: 1283915643271
Node triggered: 0: 1283915643271
Process started : 1283915643271
I'm just printing the node id and the time in milliseconds.
Is this the way is supposed to be?
I guess technically "after" could be anytime after, but if I use the
afterProcessStarted event, I get it after the whole process has
completed!, which it's not useful at all.
The "before" events work as expected I think.
I'm using Drools Flow 5.1.0.
rules-users mailing list