ActiveBPEL® Designer User’s Guide

Break

This is an ActiveBPEL 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.

The break activity exits the nearest enclosing while, repeat until, 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 while, repeat until, 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.

You can use a break to exit normally instead of throwing a fault and forcing termination of the process.

Required and optional properties for break

Required Properties

Optional Properties

none

Name. See Selecting Activity Labels

Join Condition. See Creating a Join Condition for an Incoming Link

Suppress Join Failure. See Process Properties

Comment. See Adding Comments to a Process

Documentation. See Adding Documentation to a Process

Setting Visual Properties and Using Your Own Library of Images

Execution State. See Viewing the Execution State of an Activity or Link

Extension Attributes and Extension Elements. See Declaring Extension Elements and Attributes.

To add a break activity:

  1. On the Process Editor canvas, select a while, repeat until, or forEach container.
  2. From the Activity palette, drag a break activity to it.
  3. The following illustration shows an example.

Break activity in a While container

XML Syntax

<break standard-attributes>
standard-elements
</break>

Example

<while>
   <targets><target linkName="Link2"/></targets>
   <sources><source linkName="Link5"/></sources>
   <condition>($counter &lt; 5)</condition>
   <flow>
     <links>
       <link name="Link5"/>
     </links>
      <if>
        <sources><source linkName=”Link5”/></sources>
        <condition>($counter = 3)</condition>
       <extensionActivity>
         ext:break name="Break"/>
       </extensionActivity>
      </if>
       <assign>
          <targets><target linkName=”Link5”/></targets>
            <copy>
              <from>($counter + 1)</from>
              <to variable=”counter”/>
            </copy>
        </assign>
   </flow>
</while>