Condition

更新时间:
复制 MD 格式

The condition node evaluates an input value against defined conditions and branches the business flow accordingly. This creates a "true" path when the condition is met and a "false" path when it is not.

Node configuration

To configure the condition node, select it from the node list on the business logic editor page.

Parameter Description
Node Name The name of the node. The name can contain Chinese characters, letters, digits, and underscores (_), and can be up to 30 characters long.
Condition configuration Click + Condition to add a condition. You can add multiple conditions for the node.
  • The data source can be one of the following:
    • fixed value: A static value.

      Available data types:

      • Number: Enter a number. Decimals are allowed.

      • Boolean: Set to true or false.

      • String: Enter a string of text.

      • Time: Select a specific point in time.

      • Array: Enter an array value. Separate items with commas (,).

      • Struct: A complex data structure of name-value pairs in JSON format. For example:

        { "firstName":"John" , "lastName":"Doe" }
    • From Node: Use a value from another node.
      • Previous Node (payload): Uses the payload from the directly preceding node. You can manually enter the name of a variable from the previous node to use its value. If no variable name is specified, the entire payload is used.

      • A parameter from any previous node, such as an attribute, time, or service from a device trigger or product node.
    • Variable: Use an existing global variable or local variable.

      For more information about variable configuration, see Variable Configuration.

  • Comparison Method: Includes operators such as greater than, greater than or equal to, less than, less than or equal to, equal to, not equal to, is null, and is not null.
You can reorder the conditions and define the logical relationship between them.
  • AND: The result is true only if all conditions are met. Otherwise, the result is false.
  • OR: The result is true if any condition is met. Otherwise, the result is false.

Multiple conditions are evaluated sequentially from top to bottom. A true result routes the flow to the "true" branch, and a false result routes it to the "false" branch.

For example: Assume you have three conditions: Condition 1 is true, Condition 2 is false, and Condition 3 is true. If you set the logical operators between them as AND and then OR, the expression true && false || true evaluates to true, and the workflow executes the "true" branch.

Node output

The node outputs either true if the conditions are met, or false if they are not.

Usage example

For a detailed example, see Step 2: Configure Air Purification and Alarm Service.