Creating a conditional branch using the branching plug-ins

Ops Center Automator Service Builder User Guide

Version
11.0.x
Audience
anonymous
Part Number
MK-99AUT002-18

You can create a conditional branch so that a step within a service template is run only when a particular condition is met.

A conditional branch is useful for running a step based on a condition that occurs during the processing of a previous step.

The following plug-ins are provided for creating a conditional branch:

  • Branch by Property Value Plug-in: Compares a service property with a specified value (or if necessary, can also be compared with a variable or step property) and then acts accordingly.
  • Branch by ReturnCode Plug-in: Compares the Return Code generated by a previous step with a value.

To create a conditional branch:

  1. Insert the branching plug-in at the point in the flow after the step where you want the branch to occur.
  2. Position the step to run, if the condition is met, beneath the branch and the position of the next steps.
  3. Draw connectors between the steps to define the flow.
  4. Set the input and output values to define the condition and specify the values.

The following figure shows an example of using the Branch by Property Value Plug-in to set up a conditional branch when a step property generated by a previous step equals the specified value.


Using the Branch by Property Value Plug-in to set up conditional branch when the step property equals a specified value.

In this example, "Step A," is run only when "out0" from the previous step equals "test."

The following figure shows an example of using the Branch by ReturnCode Plug-in to set up a conditional branch when a return code generated by a previous step meets a specified criteria.


Example of using the Branch by Property Value Plug-in to set up a conditional branch when a step property generated by a previous step equals the specified value

In this example, "Step A" is run only when the return code from the previous step equal "0."

To create a more complex conditional branching, you can use multiple Branch by Returncode plug-ins so that one step is run when a condition is met and another step is run when the condition is not met.


Example of using the Branch by ReturnCode Plug-in to set up a conditional branch when a return code generated by a previous step meets a specified criteria