Exist the multi instance sub-process

Hi I am looking for a way to exist a multi instance sub-process without defining the loop cardinality. I have a user form in the multi instance sub-process and want the user to fill out that form repeatedly until he wants to exist. Is that doable in Camunda? For now, I know there are two ways to exist the loop. (1) use loop cardinality, but I don’t know how many times the user want to fill out the form. (2) use a collection and have the process iterate over the collection and exist when it’s done. Is there a way to have the user set a variable to a specific value, then the process will end? or have a button in the user form so the process will end when the user click on that?

What you are describing is a Loop rather that a multi-instance.
I’m not seeing how to set the completion criteria for a loop though.

In documentation, you build your subprocess, put the loop marker on it, and then usually use an annotation to indicate when to exit the loop. (eg. ‘Repeat steps until User selects “More” as “No”’, or ‘Repeat while query for next task returns results’ )

But I don’t see “Completion Condition” as an option in the properties panel when a subprocess is selected.

Thanks for the response. I choose multi-instance is because the answer from this post: Sub process-loop - #7 by ayatalat. and I don’t see completion condition when using a loop. But I does see completion condition when using a multi instance. But it does not work as I expected. Also loop cardinality or collection to iterate is required for using a multi instance process.

Multi-instance is supposed to be more akin to a For-Do loop rather than a While-Do loop.

Here’s the section of the docs that cover the “Recommended Practice”


Yes, for While-Do, I usually model it as an explicit loop with a conditional gateway with the exit / loop condition encoded.

1 Like