cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Number of Parallel Tasks using Parallel Gatway

sankarts
Champ in-the-making
Champ in-the-making
I would like to perform identical task on multiple target elements concurrently as "parallel tasks".

The catch here is that number of parallel tasks is variable (may vary from 2 to 20 for example) and shall vary on every run of "workflow process instance". Also, the count of parallel tasks is not known in advance.

Query:
Whether Activiti supports executing variable number of parallel tasks? If so, how the same can be achieved?

Please let me know, if you need any further info.

Thanks in advance.
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
Yes, use a multi instance (http://activiti.org/userguide/index.html#bpmnMultiInstance) for the specific task. it takes a collection.

sankarts
Champ in-the-making
Champ in-the-making
Thanks for the reply.

As part of multi-instance, I specify for example, activiti:collection="$(names}".
where "names" contains 2 values say abc & xyz.

Using multiple parallel tasks, how can I create 2 files concurrently with one file name being "abc" and other being "xyz"?

It would be great, if you can point me some sample.

jbarrez
Star Contributor
Star Contributor
Use a service task in a multi instance. Create a file based on the elementVariable (variable is available in the service task). And that's it.