cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically add an instance to Multi-instance

cgarci
Champ in-the-making
Champ in-the-making
Hello,

I am new to activiti so please excuse me if what I am asking is to basic but I could find any proper answer for it in the forum. Thanks!

Scenario

I have to implement a workflow to review different files/attachments that a PM uploads to a repository.
This revision process for each of those files will consist in 5 different steps. (subprocess)
The file revisions are independent.
While there are still some files left to be reviewed, the PM can upload new files.
When a new file is uploaded, a new revision process for that file must be started … and joined to the N previously uploaded files with an on-going revision.
Once all the files are marked as review, the process is finished.

Pseudo-Schema:

Start revision (human activity) -> Review files (n independent sub-processes) -> Close revision (human activity/service call, whatever)

… but the number of files (n) might evolve during the review process (it is not known in advance).

What does activiti offer?

I have read this on the documentation about Multi-instances:

"The number of instances are calculated once, when entering the activity"

So if this is true, my hands are laced, aren't they?

Question

Is there are way to dynamically add a new "instance" to a currently "started" multi-instance activity?

If so, could you please explain me how?

Thanks a lot in advance,

Carlos
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
Yes indeed the number of instances are calculated once (as per the BPMN 2.0 specification).

So you will need to explicitely model the 'wait for next documents' in your process, which then goes into the creation of new steps … which will probably not be easy.