Updated on 2023-09-20 GMT+08:00

Condition Judgment

Diagram Element

Parameter Description

The following figures show parameters of the Condition Judgment diagram element.

The parameters are described as follows:

  • Module: diagram element name, which can be customized as required. The name is not displayed on the diagram element.
  • Condition Editing: In this area, you can configure different judgment conditions, based on which different branches can be implemented in a flow.

    If you click Simple Expression, the following parameters need to be set:

    • Parameter 1: Click the text box. In the displayed Select Variables dialog box, select a global variable, flow variable, or system variable as required.
    • Relational operator: relational operator, which is used to define the relationship between parameter 1 and parameter 2.
    • Parameter 2: Manually enter a variable or constant.
    • Logical operator: The options are AND and OR. The priorities of different operators are the same, and conditions are judged one at a time from top to bottom.

      By selecting a logical operator, you can add multiple condition expressions in the same condition. If you select AND, multiple condition expressions must be met at the same time. If you select OR, only one of the condition expressions must be met.

    • You can click Delete to delete a condition expression.

    If you click Complex Expression, a complex condition expression must be entered in the text box. The expression can contain the parameter name, value, and complex operation. After a series of operations, the complex expression returns a value of the Boolean type, for example, true or false.

    • The formats of flow variables, system variables, and global variables are as follows: FLOW.Parameter name, SYS.Parameter name, and GLOBAL.Parameter name.
    • The priorities of operators used in complex expressions are as follows: parentheses > arithmetic operators > relational operators > logical operators. Operators at the same level (except arithmetic operators) have the same priority. The operators of other levels have the same priority. The symbols of each type are as follows:

      Parentheses: ()

      Arithmetic operator: *, /, %, +, – (The priorities of the asterisk, slash, and percent sign are higher than those of the plus sign and minus sign.)

      Relational operators: >, >=, <, <=, ==, !=

      Logical operators: &&, ||

      In addition to basic logical expressions, functions based on the mvel2 expression are also supported. For example, the flow variable FLOW.testvalue is set to abc, and the contains function is used to determine whether the d character is contained. If the determination result is false, the branch is not executed.

      Similarly, simple functions may be used as follows:

      FLOW.testvalue.substring(0,1)=='d' checks whether the first character is d.

      FLOW.testvalue.endsWith(classification) checks whether the value ends with c.

      If other functions are required, develop them under the guidance of Huawei engineers.

  • You can click New Condition to add multiple conditions, which can map different branches.

    A maximum of 20 conditional branches are allowed.

  • Click to delete a condition.
  • Click Save to save all parameters set on the current page.
  • branch: Click the connection line between a condition judgment diagram element and a branch diagram element, and select the condition to enter the branch from the drop-down list. If no condition is selected, the branch is used as a default branch, which is executed when none of the conditions are met.

Typical Application Scenarios

The system enters a branch in a flow based on the input condition. For example, the system can enter different branches based on the flow execution result (success or failure).