Business Process and Data Transformation Language Reference
<break>
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Break out of a loop and exit the loop activity.
Synopsis
<break/>
Details
Attribute or Element Description
name, disabled, xpos, ypos, xend, yend attributes See Common Attributes and Elements.”
<annotation> element
Description
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">

  //...do various things...

  <if condition="somecondition">
    <true>
      <break/>
    </true>
  </if>

  //...do various other things...

</while>
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>.
Note:
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
<continue>