Sub process-loop

i have a service task that call http-request to get a number of elements as array
i want to loop through this array and check each element if element has a specific property then do another service task otherwise end the workflow

so i try to set sub-process loop to take each user but i have a problem that i don’t know how to set loop cardinality

here is a my model

Use a multi-instance task marker. You can pass it a list of objects and it will run for each instance.

1 Like

i already use subprocess as loop but each time i deploy, the workflow never enter the subprocess
i only want the subprocess to loop on each element and check

Don’t use a loop on your sup proces, use multi-instance instead

ok, i use multi-instance but i want loop counter inside the sub-process to know which element i check
it seem like sub-process don’t see any process variable from outside

@ayatalat if you use multi-instance, you have execution-local variable available inside your sub-process called ‘loopCounter’ (and few others)

check this: https://docs.camunda.org/manual/7.11/reference/bpmn20/tasks/task-markers/

i try to set process Variable in first service task but it gives me undefined and i also try to set localvariables in service task it has the same problem undefined

Note : i add service task as external and i set process variable in external script

I have a subporcess which i am initally calling from a service task, now what i want is that this sub process got executed repeatedly after every 2min, until a trigger is happend. can any one answer that.