Loop Begin Activity

<loop-begin-activity id="1">
    ...

    <loop-type name="do-while"/>

    ...

    <condition>
      <expression id="1" data-item-lhs="Context_Loop.loopCount" 
        operation="&lt;" data-item-rhs="UserAccountWDO.size()"/>
    </condition>

    <block-endpoint-ref activity-id="5"/>

  </loop-begin-activity>
loop-type
The loop-type specifies how the loop will be executed as detailed in Loop Type. The only two valid values for the name attribute are while and do-while.
condition
The condition tag specifies the condition that will be evaluated based on Workflow Data Object values (see: Workflow Data Objects). When list workflow data objects are present in the workflow, two attributes that are not part of that workflow data object metadata are made available when creating a loop condition expression using a list workflow data object. These are as follows:
  • size() : This will evaluate to a number (of type INTEGER) to indicate the number of items in the list.
  • isEmpty() : This will evaluate to a BOOLEAN flag to indicate if the list contains any elements or not.

The actual condition metadata is used in other places in the process definition metadata and is thus described in the dedicated chapter, Conditions.

block-endpoint-ref
The block-endpoint-ref in this context allows the loop-begin-activity to recognize its associated loop-end-activity. This information is useful to the workflow engine when executing the loop. For example, when a while loop's exit condition evaluates to true before the loop executes, the block-endpoint-ref tells the workflow engine which activity to jump to and continue the execution of the process.