Hello flowable experts,
In my diagram, I have a lot of call activities, which are multi instance and are executed in parallel (isSequential="false"
).
Consider the following example, which is one of the call activities in my diagram:
<callActivity id="deleteServicesCallActivity" name="Delete Services Sub Process" flowable:async="true" calledElement="deleteServiceSubProcess" flowable:calledElementType="key" flowable:inheritVariables="true" flowable:completeAsync="true" flowable:fallbackToDefaultTenant="false">
<extensionElements>
<flowable:in source="serviceToDelete" target="serviceToDelete"></flowable:in>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="false" flowable:collection="servicesToDelete" flowable:elementVariable="serviceToDelete"></multiInstanceLoopCharacteristics>
</callActivity>
As my application might execute a lot of process instances, I want to limit the number of parallel call activities per process instance. For example, if the servicesToDelete
collection contains 100 elements, I want to process 10 in parallel and the others to “wait at the queue” until an element (respectively an activity) is completed. What I imagine as perfect option is to specify a value for the nrOfActiveInstances
in a similar way to loopCardinality
.
My current solution is to have two nested call activities - the main one will execute sequentially the inner one until all elements are processed. The inner one will process 10 or less elements in parallel.
Even though I have a possible solution, I am looking for a better and simpler approach. So any advice will be highly appreciated.
Thank you in advance,
Rado