This topic describes how to configure the Branching by Conditions component, which allows for the combination of multiple conditions to alter the execution path of a flow.
Component information
Icon
Name
Branching by Conditions.
Preparations
Go to the canvas page of an existing flow or a new flow.
Go to the canvas page of an existing flow.
Log on to Chat App Message Service Console. Choose Chat Flow > Flow Management. Click the name of the flow that you want to edit. The canvas page of the flow appears.
Create a new flow to go to the canvas page. For more information, see Create a flow.
Procedure
Click the Branching by Conditions icon on the canvas to view the configurations on the right.
Configure the component based on your needs. For more information, see Parameters.
Click Save in the upper-right corner. In the message that appears, click Save.
Parameters
You can click Add Branch to add a new branch. The following table describes the parameters about branch rules.
Parameter | Description | Example |
And/Or | If the branch has multiple rules or rule groups, configure the evaluation method by selecting And/Or.
| Example of And: This example indicates that subsequent operations will only be executed if both userChooseLanguage is English and incomingMessage contains English are satisfied simultaneously. Example of Or: This example indicates that subsequent operations will be executed if either userChooseLanguage is English or incomingMessage contains English is satisfied. |
Add Rule, Add Rule Group | You can click | |
Please select a variable | Select a variable to be evaluated from the Please select a variable drop-down list. These variables come from the default active variables in the active variable list and user-defined variables. For more information, see Use available variables. | |
Please select an operator | Select a rule from the drop-down list. The rules are as follows:
| |
Please enter | Enter custom content to be matched. | |
Configuration example
In this example:
When the user satisfies the Chinese branch rule, a Chinese message will be triggered for sending, and the flow will continue.
When the user satisfies the English branch rule, an English message will be triggered for sending, and the flow will continue.
When the user does not satisfy any branch rule, the flow will enter the "else" branch, triggering a jump to the node component, and the flow will continue.