cancel
Showing results for 
Search instead for 
Did you mean: 

Ho to design sub-processes (1 to many)

r3dge
Champ in-the-making
Champ in-the-making
Hi,

I designed a main process that is linked with one business object. The business object is a batch that contains many folders.

The first task of my process match with the batch business object (1 task for 1 batch).

But for the second task i would like to create many task instances : 1 task for each folder contained in the batch object.

I guess the better way to do that is to design a subprocess that could be instancied for each folder.

Is this the good way to do that ? is there a best design pratice for that ?

thank u

r3dge
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
A multi instance embedded subprocess should do the trick.

r3dge
Champ in-the-making
Champ in-the-making
Ok thanks for your response.

Does it means that a java service task has to be created in the main process to launch every embedded subprocess ?

jbarrez
Star Contributor
Star Contributor
No, simply making the embedded subprocess multi instance will do the trick.

r3dge
Champ in-the-making
Champ in-the-making
Indeed !

Some precisions (about variables) that would perhaps help someone :

<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="docids" activiti:elementVariable="docid"></multiInstanceLoopCharacteristics>

Property "activiti:collection" is an array that contains all values for the "activiti:elementVariable". That means that each subprocess is started with each value of the array.

++
r3dge