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

Conditionally cause an immediate change in the flow of execution.
Synopsis
<branch condition="myVar='1'" label="JumpToMe" />
Details
Attribute or Element Description Value
condition attribute Required. An expression that, if true, causes the flow of control to jump to the identified <label>. An expression that evaluates to the integer value 1 (if true) or 0 (if false). The expression must use the scripting language specified by the containing <process> element.
label attribute Required. The name of the <label> to jump to. A string of 0 to 255 characters.
name, disabled, xpos, ypos, xend, yend attribute See Common Attributes and Elements.”  
<annotation> element
Description
The <branch> element causes an immediate change in the flow of execution if the value of its condition expression is true. Control passes to the <label> element whose name is specified as the value of the label attribute in the <branch>.
In the following BPL example, if the condition expression is true, the flow of control shifts directly from the <branch> with the label value TraceSkipped to the <label> with the name value TraceSkipped, while the intervening <trace> element is ignored:
<branch condition="myVar='1'" label="TraceSkipped" />
<trace value="Ignore me when myVar is 1..." />
<label name="TraceSkipped" />
If the <branch> condition expression is false, control simply passes to the next BPL statement following the <branch>, in this case <trace>.
A destination <label> must be in the same scope as the <branch> that references it. Thus:
In addition to these restrictions, each <label> name value must be unique across the entire BPL business process, not just within the current scope.
Caution:
As is true in all programming languages, the BPL branch mechanism must be used with care. The BPL editor does not prevent basic programming mistakes such as infinite loops or invalid branch cases.