Loop Over Actions or Invoke Connections While a Condition is Satisfied with a While Action

The while action enables you to loop over actions or invoke connections as long as a specific condition is met. You define the condition for the while loop in the Expression Builder. The while action is available in both scheduled and application integrations.

Creating a While Action

Note:

Variables used in while action statements can be of several types, including number, string, and boolean types.
  1. Add a while action to an integration in either of the following ways:

    • On the side of the canvas, click Actions Integration actions icon and drag the While action to the appropriate location.
    • Click Add icon at the location where you want to add the while action, then select While.

    The Configure While panel opens. This includes a Sources tree of elements.

  2. Click Edit Edit icon under Configure While to enter a name and optional description for the while action.

  3. Manually enter, select from the drop-down list, or drag an element from the Sources tree to the Value field. You can also add functions.

  4. Select an operator.
  5. Enter a value in the Value field.


    The Sources tree is shown on the left. On the right the Value, Operators, and Value fields are shown. Both Value fields have a clear icon and a switch to developer mode icon.

  6. Click Save.

    For this example, while the counter is less than or equal to 10000, the integration loops over the condition. When the condition is not met, the looping ends.


    Description of oic3_while.png follows
    Description of the illustration oic3_while.png

  7. Drag invoke connections or other actions for configuration to the + sign that is displayed inside the while action. These invoke connections and actions are processed as long as the condition set in the while action is met.


    The While action is expanded to show assign and logger actions. A separate logger action is shown that is outside the while action.

  8. If you want to edit the name or expression, double-click the While icon or select Actions Actions icon, then Edit.

    Note:

    Deleting a while action has no impact on downstream processing of the integration because the while action does not have any output. Any changes in the upstream actions in the integration that impact the while condition result in the display of a warning icon on the while action.

Track the Status of a While Action During Runtime

During runtime, you can track the status of the while action in the Instances page through the tracking diagram and activity stream for an activated integration.

  1. In the navigation pane, click Observability, then Instances.
  2. Click the business identifier value of the integration to track.

    The integration flow (including any while actions) is displayed. Any while action failures are identified by red.

Related Documentation
The following sections provide examples of using a while action in an integration: