Conditional Branch

  • Last update: June 20, 2025
  • Overview

    Version

    FineDataLink VersionFunctional Change

    4.1.0

    Supported the selection of parameters via a collapsible tree when you add parameters in the Conditional Branch node.

    Application Scenario

    In data development, you may need to use a variable as the judgment condition and establish connections between nodes and upstream nodes or other tasks, thereby flexibly controlling execution prerequisites for downstream nodes.

    Example:

    • When the sales volume of a department reaches a certain threshold, mark the department as excellent.

    • Determine whether to execute Task 2 based on the execution result (success/failure) of Task 1.

    • When the number of separated personnel in a department reaches N, mark the department's stability as at risk.

    Function Description

    You need to use the Conditional Branch node in conjunction with the Parameter Assignment node. When the parameter value meets a certain condition, the corresponding downstream node(s) will be executed. When the parameter value does not meet a certain condition, the corresponding downstream node(s) will be skipped. The unexecuted downstream node(s) are not considered as a failure and do not affect the overall task execution.

    1.3(2).png

    Usage Instruction

    Preparing Parameters

    For details about parameter descriptions, see Parameter Overview.

    You need to use the Conditional Branch node in conjunction with the Parameter Assignment node. When the parameter value meets a certain condition, the corresponding downstream node(s) will be executed.

    Note:

    1. If only one parameter value is set as the condition, you can either add a Conditional Branch node and connect it to the Parameter Assignment node or directly use the Conditional Branch node to determine whether to execute the subsequent nodes, as shown in the following figure.

    2.1-1(E.jpeg

    2. If multiple parameter values are set as the conditions, since the Conditional Branch node can only judge one parameter value at a time, you need to place the Conditional Branch node and subsequent nodes to be conditionally executed inside a Loop Container node. The Loop Container node will iterate through all parameter values, as shown in the following figure.

    2.1-2(E.jpeg

    Description of the Setting Items of the Conditional Branch Node

    The following figure displays the setting items of the Conditional Branch node.

    2.2.png

    Downstream Nodes

    If the condition is met, the corresponding downstream node(s) will be executed. Otherwise, the node(s) will be skipped.

    Judgment Conditions

    1. Description of judgment conditions:

    After the conditional judgment, the Conditional Branch node will return a Boolean value: TRUE/FALSE.

    • When the return value is TRUE, the corresponding downstream node(s) will be executed.

    • When the return value is FALSE, the corresponding downstream node(s) will not be executed.

    • When the return value is Null, it means that no judgment is performed, and the downstream node(s) will be executed directly.

    Built-in parameters are supported in conditional judgment. You can directly input parameter names in Condition Configuration, using the format ${Parameter name}.

    iconNote:
    A condition can consist of multiple conditions connected by AND/OR operators.

    Different judgment conditions are provided based on different parameter types:

    iconNote:
    Starting from FineDataLink V4.1.1, the conditional judgment logic has been standardized. For details about each operator, see Condition Judgment Logic Description.
    Parameter TypeSupported Filtering Condition

    Text

    In, Not In, Contain, Not Contain, Begin with, End with, Not Begin with, Not End with, Null, and Not Null

    Date

    Between, Not Between, Before, After, Equal to, Not Equal to, Null, and Not Null

    Numeric (Integer, Double)

    In, Not In, Between, Not Between, Greater Than, Less Than, Greater Than or Equal to, Less Than or Equal to, Null, and Not Null

    Boolean

    TRUE and FALSE

    2. Parameter selection via a collapsible tree:

    FineDataLink of V4.1.0 and later versions support parameter selection via a collapsible tree during parameter adding. Available parameter types include Task Parameter, Global Parameter, and Built-in Parameter, as shown in the following figure.

    2.2.2-1.png

    3. Description of constant condition values:

    Directly input constant-type condition values that are formatted the same as when they are defined. The following table shows the specific requirements.

    Type
    ExampleNote

    Number (Single)

    1


    Number (Array)

    1.4,2.6,4.8,5.6

    Separate numbers by commas (,).

    Text (Single)

    Text 1


    Text (Multiple)

    'Text1','Text2'

    Enclose the text in single quotes ('') and separate them by commas (,).

    Here’s an example using text constant values. The specific setting is shown in the following figure.

    2.2.2-2.png

    Configuring Subsequent Nodes

    You need to configure the nodes to be executed after the Conditional Branch node based on actual requirements.

    Procedure

    Example: You want to write the corresponding machine maintenance level to another table based on the daily crash times (on the task execution date, which is June 11, 2025).

    Database Table Description

    The example task uses two tables, and their table names and fields are described as follows:

    Edown: The number of daily crashes of each machine in a simulated production environment is automatically written into this table.

    3.1-1.png

    Estatus: The machine maintenance levels are written to this table every day based on the number of daily crashes in the Edown table. Different numbers of daily crashes correspond to different maintenance levels, which requires conditional judgment.

    3.1-2.png

    Machine maintenance levels are described as follows:

    • If the number of daily crashes is 0, the machine maintenance level is normal.

    • If the number of daily crashes is greater than 3, the machine maintenance level is critical.

    • If the number of daily crashes is greater than or equal to 1 and less than or equal to 3, the machine maintenance level is moderate.

    Setting Parameters

    Since different numbers of daily crashes correspond to different levels, the machine maintenance level should be determined based on the number of daily crashes. Therefore, it is necessary to output the number of daily crashes as a parameter, so that the subsequent Conditional Branch node can determine the machine maintenance level accordingly.

    1. Create a scheduled task, drag in a Parameter Assignment node, and retrieve the number of daily machine crashes, as shown in the following figure.

    3.2-1.png

    Click Data Preview, as shown in the following figure.

    3.2-2.png


    2. Output the number of daily crashes as a parameter, as shown in the following figure.

    iconNote:
    You are advised to set debug values for parameters to facilitate viewing the effects when subsequent nodes reference the parameters. Debug values do not take effect during actual execution.

    3.2-3.png

    3. In Node Remark, enter Obtain the number of crashes today., as shown in the following figure.

    3.2-4.png

    Logging Levels

    1. Drag in an SQL Script node, write the current date and normal level to the Estatus table, and name the node Normal-Level Logging, as shown in the following figure.

    3.3-1.png

    2. Drag in another SQL Script node, write the current date and moderate level to the Estatus table, and name the node Moderate-Level Logging, as shown in the following figure.

    3.3-2.png

    3. Drag in another SQL Script node, write the current date and critical level to the Estatus table, and name the node Critical-Level Logging, as shown in the following figure.

    3.3-3.png

    Setting the Conditional Branch

    1. Drag in a Conditional Branch node between the Parameter Assignment node and the SQL Script nodes. Connect the Conditional Branch node to the upstram Parameter Assignment node and the three downstream SQL Script nodes, as shown in the following figure.

    3.4-1.png

    Click the Conditional Branch node and three new branches is displayed, each corresponding to one of the downstream nodes. You can set Judgment Condition for each branch to determine which one to run.

    3.4-2.png

    2. Set Judgment Condition for the SQL script node named Normal-Level Logging. When the number of crashes is 0, this branch is executed, as shown in the following figure.

    3.4-3.png

    Follow the same steps to set Judgment Condition for the other two SQL Script nodes, as shown in the following figure.

    3.4-4.png

    Effect Display

    Click Run to execute the task. The running result in Log upon successful execution is shown in the following figure.

    3.5-1.png

    The number of machine crashes on June 11, 2025 is 2, so only the SQL Script node named Moderate-Level Logging will be executed, while the remaining two SQL Script nodes will be skipped, as shown in the following figure.

    3.5-2.png

    The following figure shows the data in the Estatus table.

    3.5-3.png

    Best Practice

    For details about best practices on the Conditional Branch node, see Using Conditional Branch to Obtain Information About Outstanding Employees.

    附件列表


    主题: Data Development - Scheduled Task
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy