While

The While action loops a series of nested actions while a condition is true.

The condition is evaluated at the beginning of the loop so if the condition is never true, it never executes its nested actions. This action is different from the DoWhile action, where the condition is evaluated at the end of the loop.

The following table shows the parameters for the While action.

Table 1. While action parameters
Name Data type Required Notes
condition JPath Yes The condition that determines whether to continue looping. A loop is an execution of all nested actions.
actions JPath Condition Yes

The sequence of actions to execute.

Must be a JPath expression that resolves to a value of true or false. References to the State should not be within the ${} notation for JPath conditions. See JPath.

XML Example:

This action executes the nested CallEndpoint action if a value exists in the State at location /next_page. The While action executes the nested CallEndpoint action until the /next_page value is null. If /next_page is always null, the nested action is not executed.

<While condition="/next_page != null">
    <CallEndpoint ... />
</While>