Decision Units

Learn how to use decision units to control data flow

A Decision unit uses a set of branches each with a Boolean condition that determines which associated Connector unit to process. When a condition resolves to true, then the associated branch is executed and the pipeline data flow follows the associated sub-pipeline. Only one branch can resolve to true. All others must resolve to false, otherwise the pipeline will give an error.

Conditions are similar to formulas except they must resolve to true. Both branches in a decision unit cannot resolve to true.

Decision unit in Mapping editor

To add the Decision unit, follow these steps.

  1. In the Pipeline dashboard, click Add Unit.

  2. Select Decision unit to add it to the pipeline.

  3. Drag a line from a unit to the new Decision unit, then click the Decision unit to open the Mapping Editor.

  4. You need to create two or more branches, one of which must resolve to true.

    1. Click Create new branch then provide a name and condition:

      1. Branch name - for example is-xapix-vehicle.

      2. Branch condition - for example request.path.type = "xapix"

    2. Click the Plus (+) sign to add a second branch and provide a name and condition as with the first branch.

    3. Continue with other required branches.

  5. Click Done to close the Mapping editor.

  6. On the Pipeline dashboard, connect one of the branches to a Connector unit. Connect other branches to their respective Connector units.

  7. Click the Decision unit to view the completed mapping in the Mapping editor.

  8. Click Done to save your changes.

Merging multiple decision units

Sometimes you may need to put a Merge unit after using a Decision units. In these instances, without a Merge unit, data from only one of the Decision units will be appear in the pipeline transformation. This may be the desired behavior you want, If not, add a Merge unit afterwards to have results from both branches to be present.

See Merge units for more details.