InterSystems IRIS Data Platform 2019.2  /  Business Process and Data Transformation Language Reference  /  BPL Elements

Business Process and Data Transformation Language Reference
Previous section           Next section
InterSystems: The power behind what matters   

Break out of a loop and exit the loop activity.
Attribute or Element Description
name, disabled, xpos, ypos, xend, yend attributes See Common Attributes and Elements.”
<annotation> element
BPL syntax permits any element that can contain a sequence of activities — <case>, <default>, <foreach>, <false>, <sequence>, <true>, <until>, or <while> — to contain a <break> element if desired.
The <break> element allows the flow of control to exit a loop immediately without completing any more of the operations inside the containing loop. For example:
<while condition="0">

  // various things...

  <if condition="somecondition">

  // various other things...

In the above example, it is the <true> element that contains the <break> element. However, the loop affected by this <break> is actually the containing <while> loop.
The example works as follows: If on some pass through this loop, the <if> element finds “somecondition” to be true (that is, equal to the integer value 1) then the flow of control passes to the <true> element inside the <if>. Upon encountering the <break> element, execution immediately exits the containing <while> loop and proceeds to the next statement following the </while>.
Loop activities that you might want to modify by using a <break> element include <foreach>, <until>, and <while>.
BPL business process code can initiate a sudden, but graceful exit by setting the business process execution context variable status to a failure value using an <assign> or <code> statement.
See Also

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-10-14 06:57:37