While
The While activity executes a contained activity repeatedly as long as, at the beginning of each iteration, its condition evaluates to true. If this condition is not true at the start, then the contained activities do not execute at all.
The While activity is similar to Repeat Until in that it provides conditional repetition, but there are two important differences:
- The While activity evaluates the looping condition before executing the contained activities, while the Repeat Until activity evaluates a condition after executing the contained activities.
- The While activity's condition indicates whether or not execution should proceed, while the Repeat Until's condition indicates whether or not execution should stop.
To build a While activity:
- From the palette, drag a While activity on to the BPEL Editor.
- Select the While, and in the Properties view, specify a condition for the While. You can do this by either manually typing an expression in the Expression field or by clicking to open the XPath Expression Editor.
- Drag an activity, such as a Scope or Invoke, inside the While.
- Specify all the properties for each activity in the While.
More Information