A task flow is a directed acyclic graph (DAG) that consists of one or more task nodes. You can create a complex task flow only by dragging and configuring task nodes.

Prerequisites

  • You have logged on to a database.
    Note If the database instance is managed in Flexible Management or Stable Change mode, you must log on to the database instance. If the database instance is managed in Security Collaboration mode, you do not need to log on to the database instance. For more information about control modes, see Control modes.
  • The database type is supported. For more information about supported database types, see Supported database types and features.

Create and connect task nodes in a task flow

This section describes how to create and connect task nodes in a task flow. You can create one or more task nodes in the task flow.

  1. Log on to the DMS console.
  2. In the top navigation bar, move the pointer over the More icon and choose Data Factory > Task Orchestration.
  3. In the Free orchestration tasks section of the Task Orchestration tab, click New task flow.
  4. In the New Task Flow dialog box, set the Task Flow Name and Description parameters and click OK.
  5. Drag one or more task nodes that you want to create from the left-side task node list to the blank area on the canvas.
    Note For more information about supported task nodes, see Task type introduction.
    Drag a task node
  6. Click the Task rename icon icon next to the task node name to change the name.
  7. Click the task node. In the right-side pane, click the Content tab and edit the code of the task node.
    Edit the code of the task node
    Note
    • You can drag the Resize button to change the size of the right-side pane.
    • If you reference variables in SQL statements, you can click SQLPreview to check whether the SQL statements are as expected. For more information about variables, see Configure variables.
    • After you edit the code, you can click Validity Check to check whether the SQL statements can be executed.
    • The SQL syntax of most databases is supported. Enter SQL statements that use the SQL syntax of the current database.
  8. Click Save.
  9. Optional. Assume that you have created multiple task nodes in the task flow. Move the pointer over a task node on the canvas, click and hold the circle, and then draw a line from the circle to another task node.
    Connect the task nodes
    You can use this method to connect multiple task nodes to form a task flow and configure the sequence for running the tasks. The following figure shows a sample task flow. In the task flow, the task a is the first task to be run and the task b is the second. After that, the tasks c and e are run at the same time. Sample task flow
    Then, you can configure scheduling properties to run the task flow at a regular interval or at a scheduled time. For more information, see Configure scheduling properties for the task flow.

    You can perform a test run on the task flow. For more information, see Publish or unpublish a task flow.

Configure scheduling properties for the task flow

You can schedule the task flow to be run as required. For example, you can schedule the task flow to be run by month, week, or day.

  1. On the task orchestration tab of the task flow that you created, click the blank area on the canvas.
  2. In the right-side pane, click the Scheduling tab.
  3. On the tab that appears, set the parameters that are described in the following table.
    Table 1. Scheduling properties
    Parameter Description
    Trigger type The scheduling type of the task flow. Valid values:
    • Cyclic scheduling
    • Schedule once
    Note If you set this parameter to Schedule once, you need only to set the Specific Time parameter.
    Effective Time The time period during which the scheduling properties take effect. The default time period is from January 1, 1970 to January 1, 9999, which indicates that the scheduling properties permanently take effect.
    Scheduling cycle The scheduling cycle of the task flow. Valid values: Hour, Day, Week, and Month.
    Note If you set the Scheduling Cycle parameter to Hour, you must set the Timed Scheduling parameter.
    Timed Scheduling The time that you specify for running the task flow. You can set this parameter in the following ways:
    • Set the Starting Time, Intervals, and End Time parameters.
      • Starting Time: the time when the task flow starts to be run.
      • Intervals: the interval at which the task flow is scheduled to be run. Unit: hours.
      • End Time: the time when the task flow stops running.
      Assume that you set the Starting Time, Intervals, and End Time parameters to 00:00, 6, and 20:59. In this case, Data Management (DMS) schedules the task flow to be run at 00:00, 06:00, 12:00, and 18:00.
    • Set the Specified Time parameter. You can specify a point in time for running the task flow.

    This parameter is displayed only when the Scheduling cycle parameter is set to Hour.

    Specified Time The time for running the task flow based on the scheduling cycle that you specify.

    This parameter is displayed only when the Scheduling cycle parameter is set to Week or Month.

    Specific Time The specific point in time at which the task flow starts to be run.

    This parameter is displayed only when the Scheduling cycle parameter is set to Day, Week, or Month.

    Cron Expression The CRON expression that is automatically generated based on the scheduling cycle and time that you specify.

    For example, you can schedule a task flow to be run at 05:00 every business day, as shown in the following figure.

    Scheduling
  4. Click Save.

    You can publish the task flow with the latest configurations. For more information, see Publish or unpublish a task flow.

Configure basic properties for the task flow

This section describes how to configure basic properties for the task flow. You can configure the basic properties by setting parameters such as Task Flow Name, Owner, and Partner.

  1. On the task orchestration tab of the task flow that you created, click the blank area on the canvas.
  2. In the right-side pane, click the Properties tab.
  3. On the tab that appears, set the parameters that are described in the following table.
    Task flow: Properties tab
    Parameter Description
    Task Flow Name The name of the task flow.
    Owner The owner of the task flow. The owner can edit the task nodes and configurations of the task flow and run tests. The owner receives an alert if the task flow fails.
    Note After you change the owner of a published task flow, you must republish the task flow. For more information, see Publish or unpublish a task flow.
    Partner The one or more stakeholders of the task flow. The stakeholders can view, but not edit, the task nodes and configurations of the task flow. They can also run tests.
    Note DMS administrators and database administrators (DBAs) are the default stakeholders of each task flow. They can also change the owners of task flows.
    Enable message notification Specifies whether to enable message notification for the task flow.
    Note To enable message notification for a task flow, make sure that a notification rule is configured for the task flow. Only DMS administrators and DBAs can configure notification rules. For more information, see Notification rule management.
  4. Click Save.

    You can publish the task flow with the latest configurations. For more information, see Publish or unpublish a task flow.

View the operation records of the task flow

This section describes how to view the operation records of the task flow.

  1. Log on to the DMS console.
  2. On the task orchestration tab of the task flow that you created, click the blank area on the canvas.
  3. In the right-side pane, click the Operations tab. You can view all the operation records of the task flow.
    Task flow: Operations tab

What to do next

Publish or unpublish a task flow