If we want to exit a Branch, Loop, or Switch, or even built-in Branches like the AssemblyLine Flow section, we use the system.exitBranch() method from a place where we can script, for example, a Hook, or even a Script Component. Calling system.exitBranch() with no parameters (or with an empty string) will cause the containing Branch to exit, and flow continues with the first component after the Branch.
We can also provide the method with a string parameter containing either:
All other values used in the system.exitBranch() call cause a break out of the branch/loop having the specified name. So, for example, the call system.exitBranch("IF_LookupOk") sends the flow after the containing Branch or Loop called “IF_LookupOk”. Note that unlike system.skipTo(), which will pass control to any named AssemblyLine component, system.exitBranch() will cause processing to continue after the specified Loop/Branch.
There is also a continue functionality in Loop Components. The following methods are available in the system object:
system.continueLoop(); system.continueLoop(name);where name is a case-sensitive string, indicating a Loop name. In the case where a Loop name is provided, the program flow is transferred to the Loop Component with that name.
Parent topic: Branch Components