Designer > Implementing a BPMN Task or Event in BPEL > Break


BPMN Implementation: Terminate throw event
This is a Process Developer extension activity. When you save the process, a message appears informing you that the process contains an activity that is not in the BPEL specification.
By default, the break activity exits the nearest enclosing scope, while, or forEach activity. You can use a break inside a container to break out of processing.
When a break executes, control is transferred to the target of the break activity. The target does not execute any further iterations and completes normally. When multiple scope, while, or forEach activities are nested within each other, a break activity applies only to the innermost activity. In the case of a parallel forEach, the break activity causes all of the executing iterations to terminate all of their executing child activities and complete normally. The break activity allows the root scope of a forEach to complete normally so that it is compensatable. Early termination through a break activity is not considered a faulting state, and therefore does not prevent compensation.
Note that you can set the BPMN Terminate property to No to change the behavior of the break to break out of loops (while, for Each and repeat until), but not scopes.
You can use a break to exit normally instead of throwing a fault and forcing termination of the process.
Required Properties
Optional Properties
Join Condition.
Suppress Join Failure. See Process Properties
Extension Attributes and Extension Elements. See Declaring Extension Elements and Attributes.
BPMN Terminate. If set to Yes (the default), stops execution out to the nearest scope, while loop or for-each loop, whichever comes first. Repeat-until loops are skipped, since they are not represented with a boundary (like a scope) and BPMN terminate does not see it as a loop. The scope or loop is considered to have completed successfully (same as throwing a fault and then catching it).
If set to No, breaks out of loops (while, for Each and repeat until), but not scopes.
To add a break activity:
  1. 1. On the Process Editor canvas, select a scope, while, or forEach container.
  2. 2. Drag a Terminate throw event to it.
The following illustration shows an example.
XML Syntax
<break standard-attributes>
<targets><target linkName="Link2"/></targets>
<sources><source linkName="Link5"/></sources>
<condition>($counter &lt; 5)</condition>
<link name="Link5"/>
<sources><source linkName="Link5"/></sources>
<condition>($counter = 3)</condition>
ext:break name="Break"/>
<targets><target linkName="Link5"/></targets>
<from>($counter + 1)</from>
<to variable="counter"/>