cancel
Showing results for 
Search instead for 
Did you mean: 

Multi Instance loop in Activiti BPM

srikanth_gandra
Champ in-the-making
Champ in-the-making
Hi,

I am new to activiti and i need help for designing one scenario in workflow. Below is the scenario.

I am using MultiInstance loop(Call Activity) for creating parlell tasks in my workflow. If user enters value as 2 then it's creating 2 parlell tasks and once the completion of those two parlell tasks then its moving to next activiti in the workflow. But my problem is when those parlell tasks are active and user updates the count to 3, then how to create another new task along with two active tasks and also it should move to the next activity only after completion of those 3 parlell tasks.  Kindly help me how to achieve this scenario using Activiti.

Also help me how to update the loop counter value when the Multiinstance loop is active?

Kindly let me know if any other information required.

Thanks,
Srikanth
8 REPLIES 8

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Srikanth,

Dynamic multiinstance counter update is not supported. Try to solve it in another way. (e.g. Signal start event)

Regards
Martin

srikanth_gandra
Champ in-the-making
Champ in-the-making
Hi,

Thank you very much for your reply.

Could you please help me how to achieve the above scenario?

Below is my scenario in detail.

I have created a Call activiti and attached a subprocess to that call activiti. That subprocess contains a user task and a service task. When user enters 2 and its creating 2 user tasks for 2 users. Now If user updates that value to 3, then it should create another user task in the same subprocess instance along with other two active tasks. Please help me how to achive this.

Thanks,
Srikanth

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Srikanth,

e.g. :
use message/signal start event to start process instead of multiinstance task. When user sets 2 -> send 2 messages/signals to start process instances. If user sets 1 -> logic must somehow choose which process to delete. If he sets 3 -> logic must recognize to send another message/signal to start process.

Regards
Martin

Thanks for your reply.

I am using multiinstance loop to create parlell user tasks. If user enters 2 then it will start the multiinstance parlell call activiti and creates 2 parlell uses tasks. Once the completion of those two user tasks then it will move to next activiti in the work flow. If user updates the counter to 3 then it should add another new task to the multiinstance call activiti along with other two tasks.

So is it possible to achieve this with out using Multiinstance loop and by using message/signal events?

Kindly help me

Thanks,
Srikanth

jbarrez
Star Contributor
Star Contributor
No, we currently don't support adding/removing instances from the multi instance at runtime.

chockyc91
Champ in-the-making
Champ in-the-making
Hi,

I am using multi instance loop with parallel tasks.
I have a requirement to wait for all the tasks to finish and then move to the next task, but I don't see any such option in Activiti.

I will a receive a message event, based on which i need to create tasks in multi- instance loop.
I am not specifying the loop cardinality value as I need to create the instances number of times the event is signalled.

If a task is completed by an User in multi-instance loop, right now it is creating the next task attached outside the loop.
But I want to wait until all the tasks in multi-instance are completed and then execute the next task.
Please help me how we can achieve the wait condition for the parallel tasks in multi-instance loop.

Thanks in Advance.

warper
Star Contributor
Star Contributor
Hi Sravani!
I assume you created event subprocesses for each execution of user task, including those added later.
Make java delegate that goes through tasks of this process and checks every task for completion. You can store tasks references in some process level variable or make some task variables for filtering on them.
After that you only need to filter out one execution to proceed. It can be done through process level variable in exclusive part of workflow flow - check its existance and if it does exist, end execution. Otherwise set variable and continue workflow.