Book a demo

← Documentation

Add a condition step to the method flow

The Condition step enables you to split the method flow to different routes depending on the value of a specified field.

Add a condition step to the method flow screenshot

The get-account method accepts an account number in the example above and returns the corresponding account details. The condition in the example determines whether the request succeeded or failed and sets a different route for each outcome.

1. Place the Condition step box in the flow

To add a condition step to the method flow, perform the following:

  1. Place the Condition step box after the step that provides the input to the condition.
    1. Place the Condition step box in the flow screenshot

In this example, the Condition step is placed after the Gactcs9 asset step.

2. Set the first condition branch

  1. Click Case 1 to set the first condition branch. The condition wizard displays the fields outputted by the step that precedes the condition step.

  2. Select the field that serves as the condition input.
    2. Set the first condition branch screenshot

In the example, select the rtMsg field responsible for storing the request success status.

  1. Click Next. The second wizard step is displayed.

  2. Set the condition branch by specifying the case name, the logical operator, and the field value.
    Click the 2. Set the first condition branch screenshot sign when you finish.

    2. Set the first condition branch screenshot

In the example, set the first branch to the outcome of a successful request (SUCCESSFUL GET).

  1. Click Close to display the method flow canvas.
    2. Set the first condition branch screenshot

  2. Open the Output step and set it to fields that constitute the first branch output.
    2. Set the first condition branch screenshot

The Output step consists of the output fields copied from the Gactcs9 asset in the example. The copied asset fields constitute the account details returned when the get-account method is successful.

  1. In the output step mapper, map the Output step fields to the output fields of the step preceding the condition and click Close.
    2. Set the first condition branch screenshot

In the example, map the Gactcs9 asset output fields to the Output step fields.

3. Set the second condition branch

  1. Open the Condition step again, click Add Case, and set the second condition branch. In addition, determine the next step for this condition branch. You can select between a New Output, Existing Output, and a New Asset step.
    3. Set the second condition branch screenshot

In the example, set the second branch to outcomes different than SUCCESSFUL GET and connect it to a new output that accepts the resulting error message.

  1. Click Close to display the method flow canvas.
    3. Set the second condition branch screenshot

  2. Open the second branch's Output step and define its fields.
    3. Set the second condition branch screenshot

In the example, the second branch output is an error message confirming that the request had failed. Manually create a field to hold that message string.

  1. In the second branch Output mapper step, map the Output fields to the output fields of the step preceding the condition.
    3. Set the second condition branch screenshot

In the example, map the rtMSG field to the second Output step errorMessage field.

  1. Click Close and review the resulting method flow.
    3. Set the second condition branch screenshot

Read more

Tell us about yourself

You've been browsing the catalog. Leave your details to keep exploring.

Privacy policy