cancel
Showing results for 
Search instead for 
Did you mean: 

Collection - Break/exit from loop

shahariar_k_bhu
Level 5
Is it possible to break/exit from a loop if a certain condition is met inside the loop? For example, if I loop through a collection named "Collection": if Collection.ID = 124, then I want to exit the loop. I don't want to end the process on the same page. One possibility would be to transfer the logic to a new page, and end the sub-process when a certain condition is met. Is it possible to exit the loop without doing that?
3 REPLIES 3

TomBlackburn1
Level 7
Hi shabu, Not sure what your issue is to be honest. Can you explain more? Can you not just use a decision stage in your loop that checks is [Collection.ID] = 124 the route out of the loop and do something else?

shahariar_k_bhu
Level 5
Yes, sure. In Java, you can easily break out of a loop when a certain condition is met. For example for(x=0; x

shahariar_k_bhu
Level 5
I decided to move the loop in to a subpage, and attached the stages after condition to an end stage. So if the condition is met, I do my calculations and end the sub-process.