Loop/Iteration to stop on condition (return OK)


I need to iterate (rather loop) on things until something happens. When it happens, I need to execute something and then return OK without continuing the iteration, kind of “break”. How can I do that ? Iteration does not seem to have a stop feature. Halt exits but with error.

Use case : file watcher. If file arrives, I launch something and exit OK which finishes the task.

Maybe I have a solution : I create a morph project “header” which calls another project with iteration. I use the “capture errors and continue option”. Then in the iteration project I iterate using the “halt project” if iteration fails. And in the project iterated I do things and when I finish I halt. So that calling project halt and header project is still OK :slight_smile:

That is a solution, indeed :slight_smile: