I’m using the ParallelMultiInstanceBehavior where the loopDataInputRef is an Expression of a Spring Bean that defines an elaborate algorithm for retrieving the Input collection.
Works great, except for the fact that this bean is called each time the execution is initialized.
Now i have to execute the bean method elsewhere to store the collection. ScriptTask doesn’t allow it unless i include secure scripting which i’m not too sure about including for this application.
So now im back to a specially written ServiceTask which has to accompany the MultiInstance pattern at all times. And since it has to be a collection of Object that Object for me is a Map to cart the variables to and fro. Which means there is some unpacking to be done as well on the parallel execution side as well.
Is there a pattern/solution i’m missing?
Example from docs for convenience:
<userTask id="miTasks" name="My Task" flowable:assignee="${assignee}"> <multiInstanceLoopCharacteristics isSequential="true" flowable:collection="${myService.resolveUsersForTask()}" flowable:elementVariable="assignee" > </multiInstanceLoopCharacteristics> </userTask>