DoWhile

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

The condition is evaluated at the end of the loop. Even if the condition is never true, the contents are executed once. This action is different from the While action, where the condition is evaluated at the beginning of the loop.

The following table shows the parameters for the DoWhile action.

Table 1. DoWhile action parameters
Name Data type Required Notes
condition JPath Yes The condition that determines whether to continue looping.
actions JPath Condition Yes 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 and PostEvent action. If there is a value in the State at location /next_page the condition is true and the nested actions are executed, and the condition check is performed until the condition is false.

<DoWhile condition="/next_page != null">
    <CallEndpoint ... />
    <PostEvent path="/current/event" />
</DoWhile>