1 of 1 people found this helpful
There is only a single thread executing any single process instance. So when you do parallel gateways they will execute sequentially. I don't know the guts well enough to know anything about order.
Another way to reason about this would be to consider how many people could write thread safe scripts for their before and after actions. No offense to you non-programmer workflow creators. Making stuff thread safe is tough. Making systems as extensible and customizable as this thread safe is a nightmare.
Found that part in the documentation:
In general, the engine executes the process sequentially. For example, when the engine encounters a script task in a process, it will synchronously execute that script and wait for it to complete before continuing execution. Similarly, if a process encounters a parallel gateway, it will sequentially trigger each of the outgoing branches, one after the other. This is possible since execution is almost always instantaneous, meaning that it is extremely fast and almost produces no overhead. As a result, the user usually doesn't even notice this.
Exactly, parallel doesn't mean multi threading programming it means "business" paralelization where microseconds usually don't mean to much.
Ok, just to extend this thought.
I had a look at the evaluation example. Both mary and john receive human tasks in the tasklist at the same time.
Event though these tasks are triggered sequentially after each other. I guess that is possible, because the human task handlers are asynchonous.
But lets imagine the node on top would be an intermediate message receive event node and the one on the bottom a timer event node. If the receive node is entered first, the process would be waiting until a message comes and the timer would not be executed (until the message comes in). Vice versa, if the timer is entered first, the timer would be finished and then the receive node would be activated (and waiting).
I think I've seen the scenario you described in jpbm-examples JUnit test suite, test case BPMN2-EventBasedSplit2. The only difference is that JUnit sample uses undefined diverge gateway and your sample uses AND diverge gateway. Could you try with non-defined diverge gateway and see if it is going to work?
Hi, thanks for your help. I noticed the EventBasedSplit as well. Unfortunately Oryx did not like it and I tried to create a work around with And and XOR gateways. Tihomir fixed it by now, see here:
However, I was still interested how this strange behaviour came up. I mean, why the timer was never executed, while even if it was synchonous, the timer should have started after everything else was finished.