The Branch by ReturnCode Plug-in branches the flow of processing based on the return value of the previous step.
This plug-in allows you to select which step to run next based on the return code of the preceding step.
A Branch by ReturnCode Plug-in connects to two branch destination steps: A succeeding step, and a step that is only run when specific conditions are met. If the return code matches the specified condition, Ops Center Automator runs the branch destination step and the succeeding step, in that order. If the return code does not match the specified conditions, Ops Center Automator runs the succeeding step only.
By using this plug-in together with a test value plug-in, you can select the steps in a flow based on a character string.
The following figure shows how the Branch by ReturnCode Plug-in is used.
Cautionary notes
- When a task is stopped or forcibly ended during plug-in execution, the task enters Completed status after the Branch by ReturnCode Plug-in finishes processing.
- You cannot change the property values when you run the service. Set the values when you create the flow.
- You can only specify literal characters in input properties. You cannot map the value of a service property or reserved property.
- If the Branch by ReturnCode Plug-in stops processing, use the hcmds64getlogs command to acquire log information and identify the problem.
Return codes
The Branch by ReturnCode Plug-in generates the following return codes:
- 0 or higher: The plug-in ended normally. The return code of the preceding step of the Branch by ReturnCode Plug-in is set as the return code.
Property list
The following properties are available for the Branch by ReturnCode Plug-in:
Property key | Property name | Description | I/O type |
---|---|---|---|
condition R | Condition | Specify the condition for the return code of the preceding step. You can choose from the following conditions:
The default value is ReturnCode=value1. |
Input |
value1 R | Value1 | Specify a numerical value against which to judge the return code, within the range from 0 to 999. The value is mapped to value1 in the condition property.
The default value is 0. |
Input |
value2 | Value2 | Specify a numerical value against which to judge the return code, within the range from 0 to 999. The value is mapped to value2 in the condition property. This value takes effect when value2 is included in a condition property.
The default value is 0. |
Input |
R: Required |
Example of a property specification
A Branch by ReturnCode Plug-in determines whether the return code is within a specified range of values.
The following describes the range of valid condition values, using the following values of the condition, value1, and value2 properties as examples.
A. The return code is 25 or greater and less than 75
condition (Condition): ReturnCode>=value1 AND ReturnCode<value2
value1 (Value1): 25
value2 (Value2): 75
B. The return code is less than 25, or 75 or higher
condition (Condition): ReturnCode<value1 OR ReturnCode>=value2
value1 (Value1): 25
value2 (Value2): 75
The following figure shows the range of return codes that match each condition.