Initially I have declared 4 task in the list to be executed.
List list = Arrays.asList(“task-1”, “task-2”, “task-3”, “task-4”, “task-5”);
Now , once process started running and entered into set start time service task under subprocess I want to modify the above list i.e; I want to remove task-4 from the list and subprocess should run only 4 times not 5 times.
Hi @Manish_Tiwari , The same can be achieved using completion_condition available inside multi-Instance component.
APPROACH-1
First, set a process variable (e.g. rerouted = true) based on the condition where you want to modify the sequence.
Then utilize that variable (rerouted) as completion_condition available inside multi-Instance component.
Add a ExOR gateway after your subprocess and check condition whether sequential flow has been rerouted or executed normally as per the original sequence.
If flow is rerouted, just send it back to the initial service-task and assign a rerouted sequence to the multi-instance sub-process.
Your flow will continue as per the modified sequence.
APPROACH-2
You can modify sequence stored as a process variable. Just modify the array stored inside camunda variable using different mechanism available to set variable programmatically.
Hi @Manish_Tiwari - @Vikas_Sharma made the same suggestion I was going to make. You do not want to be programmatically altering your processes; instead, you want to model for these conditions.