Repetitive activities

BPEL offers three activities that allow the repeated execution of a piece of business logic. One of these activities is the while activity. The while activity is a structured activity, i.e. it has a child nested within. The while activity allows you to repeatedly execute the child activity as long as a given condition evaluates to true. The condition is specified on the while activity and gets evaluated at the beginning of each iteration, which means consequently that the body of the while activity might not be executed at all (if the condition does not evaluate to true at all).

In contrast, the repeatUntil activity has the difference that the body of the activity is performed at least once, since the condition is evaluated at the end of each iteration.

The third activity in the group of repetitive activities is the forEach activity. In its default behavior, the forEach activity iterates sequentially N times over a given set of activities. A use-case that can be imagined is that it iterates over an incoming order message where the order message consists of N order items. Technically, the forEach activity iterates its child scope activity exactly N times where N equals the finalCounterValue minus the startCounterValue plus 1.

There are two variants forEach activity: sequential and parallel, as specified by the parallel attribute.

One restriction applies to the forEach activity: other structured activities can have any arbitrary activity as a child activity, whereas the forEach activity can only have a scope.


See also:

- WS-BPEL 2.0 Primer: Repetitive activities Focus Areas: BPEL | DITA | ebXML | IDtrust | OpenDocument | SAML | UBL | UDDI
OASIS sites: OASIS | Cover Pages | | AMQP | CGM Open | eGov | Emergency | IDtrust | LegalXML | Open CSA | OSLC | WS-I