Differences in Boundary Event Behavior on Sync and Async Multi-Instance Activities

Dear Flowable experts,

Is it expected that there is a significant difference in behavior of the boundary events on multi-instance activities depending on whether the activities as such are synchronous or asynchronous?

Background for the question is the following observation:

  • When a multi-instance activity is synchronous and an attached boundary timer event fires, there is only one execution created as a result of this.
  • When a multi-instance activity is asynchronous and an attached boundary timer event fires, there are n+1 executions created, where n is the number of instances in the multi-instance activity and the 1 extra refers to the multi-instance root execution.

We have observed this phenomenon for the following process:
image

  • When the call activity is synchronous there will be only one Additional User Task, independently of how many instances there are in the call activity
  • When the call activity is asynchronous there will be n+1 Additional User Tasks created after the timer event fires.

In our investigation, we have seen that this is a result of the ContinueProcessOperation#executeMultiInstanceSynchronous called only once for the synchronous multi-instance activity with CallActivity as its parameter, whereas for the asynchronous activity it gets called exactly n+1 times. (The caller is ContinueProcessOperation#continueThroughFlowNode)

(In fact, there are actually n+1 timer events which get created and fire in the asynchronous case)

Thank you!

Best regards,
Vasil Tsimashchuk

Fix proposal: Fix for Boundary Events on Asynchronous Multi-Instance Activities by vasil-tsimashchuk · Pull Request #2916 · flowable/flowable-engine · GitHub

Thanks for the clean PR! Merged it.

1 Like