Branch Node
A Branch node is an IF-ELSE node that provides the multi-branch condition judgment capability. It is used to design branch processes and implement the logic judgment function.
Each condition branch of the Branch node supports multiple judgment conditions (AND and OR) and multiple condition branches.
When parameters are input to the Branch node, the node checks whether the input meets the preset conditions in each condition branch one by one. If the input meets the preset conditions, the workflow process after the corresponding branch is executed. If no branch meets the preset conditions, the workflow branch corresponding to ELSE is executed.
The Branch node is optional. If it does not need to be configured, skip this section.
To configure the Branch node, perform the following steps:
- Drag the Branch node on the left to the canvas and click the node to open the node configuration page.
- Configure the Branch node by referring to Table 1.
Table 1 Branch node configuration Configuration Type
Parameter Name
Description
Parameter configuration
IF
The IF branch consists of [Judgment parameter comparison Condition comparison Parameter], which forms a condition expression.
- Judgment parameter: left part of the condition expression. You need to select the output parameter from the previous node.
- Comparison condition: middle part of a condition expression. Currently, the following comparison conditions are supported: length greater than, length greater than or equal to, length less than, length less than or equal to, equal to, not equal to, including, not including, empty, and not empty. Comparison conditions displayed vary depending on judgment parameter types.
- Comparison parameter: right part of a condition expression. It supports the reference and input types.
- ref: You can select the output variable values of the previous nodes contained in the workflow.
- literal: The value can be customized.
- Add conditions: Click + to add multiple condition expressions to the current condition branch. The multiple condition expressions are connected by AND or OR.
- Click and or or to switch the operation logic of the branch expression.
ELSE
Determines whether to execute subsequent workflows in the default branch if no preset condition branch is met. If no branch meets the conditions, the default branch is used.
Add branch
You can add a new ELSE IF branch. The configuration method of the new branch is the same as that of the IF branch.
Figure 1 Branch node configuration example - After completing the configuration, click OK.
- Connect the Branch node to other nodes.
Examples:
The following uses the String, Integer, and Boolean types as an example to describe how to define parameters of the three types in the Start node to simulate the input parameters of the Branch node and implement logical judgment on parameters of different types under different conditions.
The node configuration is as follows:
- Start node: Define three types of parameters: string_key of the string type, int_key of the integer type, and bool_key of the Boolean type.
- Branch node: Add three conditions to the IF branch. The parameters of the condition expression reference the preceding three types of parameters of the Start node. The comparison conditions displayed vary according to the parameter type.
For example, for the String type, the comparison conditions are about the length, inclusion, and emptiness of the string. In the example, whether string_key includes "abc" is checked.
The Integer type is used to determine whether the value meets the "greater than", "less than", or "equal to" conditions. In the example, whether int_key is greater than 6 is checked.
The Boolean type is used to determine whether the value is true or false based on the preset condition. In the example, whether bool_key is true is checked.
Click Test run and enter the following configuration: string_key: abcd, int_key: 7, and bool_key: true. View the execution result.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot