To make a conditional judgment in a task flow, you can add a conditional branch node to the task flow. The subsequent tasks in the task flow can be run only if the conditional branch node meets the specified conditions. This topic describes how to configure a conditional branch node.

Prerequisites

A task flow is created. For more information, see Overview.

Scenarios

During the execution of a task flow, if the conditional expression of a conditional branch node evaluates to true, the subsequent tasks are run. Otherwise, the subsequent tasks are not run. You can apply a conditional branch node to the following or other similar scenarios:
  • Back up and delete data when the number of data entries reaches the specified value.
  • Send a notification when the sales amount meets the specified condition.
  • Check whether a specific file exists. If the file does not exist, create it.

Procedure

  1. Log on to the DMS console V5.0.
    Note To switch to the previous version of the DMS console, click the 5租户头像 icon in the lower-right corner of the page. For more information, see Switch to the previous version of the DMS console.
  2. In the top navigation bar, click DTS. In the left-side navigation pane, choose Data Development > Task Orchestration.
    Note If you are using the previous version of the DMS console, move the pointer over the More icon in the top navigation bar and choose Data Factory > Task Orchestration (New).
  3. Click the name of the task flow that you want to manage to go to the details page of the task flow.
    Note For more information about how to create a task flow, see Overview.
  4. In the Task Type list on the left side of the canvas, drag the Conditional Branch node to the blank area on the canvas.
  5. Double-click the Conditional Branch node.
  6. On the configuration tab of the conditional branch node, configure one or more conditional expressions.
    • Select an upstream variable or a state from the Variable Name drop-down list.
      Note
      • You can click the Variable Setting tab in the right-side navigation pane to view the upstream variables and task states on the Input Variables tab.
      • If you select a state from the Variable Name drop-down list, you do not need to set the Relational Operator or Variable Value parameter.
    • Select a comparison operator from the Relational Operator drop-down list.
    • Enter the expected variable value or variable in the Variable Value field.

      The variable must be in the ${Variable name} format. You can enter the following three types of variables:

      • Upstream variable: Upstream variables are output variables from upstream nodes. You can click the Variable Setting tab in the right-side navigation pane to view the upstream variables on the Input Variables tab.
      • System variable: You can click the Variable Setting tab in the right-side navigation pane to view the system variables on the Input Variables tab. For more information about the system variables, see System variables.
      • Time variable: Use the default time variables or task flow variables. For more information about how to configure task flow variables, see Configure time variables.
    • Optional: Click an icon to the right of the conditional expression to create or delete an expression.
      • Plus icon: Create a conditional expression at the same level as the original expression and select a logical operator from the logical operator drop-down list to use between the new expression and the original expression.
      • Plus icon: Create a conditional expression and move it to the next level together with the original expression. Select a logical operator from the logical operator drop-down list to use between the new expression and the original expression.
      • Subtraction icon: Delete a conditional expression.
      Conditional expression
    Note
    • You can create up to three levels of conditional expressions.
    • You can view the judgment logic of the conditional expressions in the Preview section to the right of the Conditional Expression section.