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
3 REPLIES 3

cgarci
Champ in-the-making
Champ in-the-making
Sorry, small misstyping error. In the first sentence I meant " I COULDN'T find any proper answer"

Thanks!

pcuvecle_9059
Champ in-the-making
Champ in-the-making
Hi,

Anybody has an idea about this ? I have exactly the same need. So far it would require to "manually" create an execution and attach it to the hierarchy managing the multi-instance + update all the others to update nrOfInstances and nrOfActiveInstances. But it seems impossible to create executions from scratch in the API.

Thanks

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Currently it is not supported by API, (I think). There are at least 2 possibilities:
1. you can extend activiti API,
2. change your process model.

I would prefer 2.

Regards
Martin