Hi Community,
I am learning & working on a BPMN workflow, and I encountered a behavior of parallel-gateway which I am not sure is normal or not. Hoping if some-one can clear my doubts.
Doubt 1 :
So, I have 3 serviceTask executed in parallel which all merges to a parallel-gateway. I wanted to run some logic once in the gateway when all 3 parallel-task are executed & arrives at the gateway.
I used execution listeners both as “start” and “end” event type.
Observation :
- The “start” event type gave some application exception. Which was expected. No Issue here. This does not get my job done. So I moved to “end” event type.
- The “end” event type was executed 3 times and logic running thrice, one for each parallel task before it. What I was expecting was, end event firing only once hence logic running only once.
My understanding was - the gateway waits for all the incoming concurrent executions and once it receives all incoming result, the gateway would then trigger “end” event once (which makes sense). And I would use this event to run my logic.
But the gateway fires end event for each incoming executions, not sure why this has been modelled this way.
Doubt 2 :
The outgoing paths of the parallel gateway are executed concurrently and not parallel in the sense of parallel threads. All records of a process instance are written to the same partition (single stream processor).
Above lines are from the documentation, what I was trying to achieve was to run 3 independent service tasks in parallel so as to decrease the response time and increase the performance. But the documentation states that the parallel tasks are not executed parallelly but it is executed concurrently (which basically would be same as having those 3 task in series), not sure what purpose parallel gateway really has or how would modelling our WF in parallel would help.
Hoping if some-one can clear my understanding.
Thank you in advance.
Avi