Invocation Task

  • Last update: September 02, 2024
  • Overview

    Version

    FineDataLink Version

    Functional Change

    3.2

    Added the Invocation Task node, which allowed you to invoke and execute other tasks within the current task, where cross-level parameter passing was not supported. (Parameters could only be passed to subtasks and cannot be passed to grandchild tasks.)

    3.7.1

    Allowed cross-level parameter passing.

    4.1.1

    Masked tasks that may cause loop invocation in the drop-down list of Invocation Task.

    Application Scenario

    To invoke other scheduled tasks on the FineDataLink data platform in the current scheduled task for task orchestration, you can use the Invocation Task node.

    iconNote:

    The invocation relationship between parent tasks and subtasks is visualized. You can view which tasks invoke this scheduled task and which tasks are invoked by the task. For details, see Task Relationship.

    Example

    Scenario Description

    Create two scheduled tasks, a parent task, and a subtask. In the parent task, invoke the subtask using the Invocation Task node, and process the result data generated by the subtask using the Data Synchronization node to obtain the required analysis data.

    Invoked Task Creation

    1. Create a scheduled task, rename it subtask, and drag a Data Synchronization node to the design page. Set the data source of the node and use the SQL statement to retrieve all the data in the sales table, as shown in the following figure.

    You can download the sample data: sales.xlsx.

    2. Synchronize the data in the sales table to the salescopy table in another database by setting the data destination. Keep the default Write Method settings, as shown in the following figure.

    3. Click Save to save this task.

    Invocation Task Creation

    1. Create another scheduled task, rename it to parent task, and drag an Invocation Task node to the design page. Select the subtask just created from the drop-down list of Invocation Task in Invocation Configuration. Keep the default setting of Parameter Passing as the subtask is not configured with parameters.

    For details about Parameter Passing, see the section "Function Description."

    2. Drag a Data Synchronization node to the design page, set the data source, and use the SQL statement to fetch data from the salescopy table (the target table of subtask) and calculate the total sales of each city, as shown in the following figure.

    3. Set the data destination. Select Auto Created Table from the drop-down list of Target Table and name the target table staticsale to save the processed data to the new staticsale table. Keep the default Write Method settings, as shown in the following figure.

    4. Connect the Data Synchronization node with its upstream Invocation Task node. In the actual production environment, you need to set the scheduling configuration of the parent task at this stage.

    iconNote:

    In this example, you only need to set the scheduling configuration of parent task since each execution of parent task triggers the execution of subtask.


    Task Running

    1. Click Run in the upper right corner to save and run the task. Ensure that the successful execution prompt appears in Log, as shown in the following figure.

    2. Check the result table staticsale in the database (generated by the Data Synchronization node in the parent task). The total sales data of each city has been stored in this table.

    Function Description

    Setting Item Introduction

    Invocation Task

    Select other scheduled tasks from the drop-down list. You cannot select the current task and tasks beyond your permission scope.

    In 4.1.1 and later versions, tasks that may cause loop invocation are masked in the drop-down list of Invocation Task. For example, if Task A invokes Task B, Task B invokes Task C, then Task C cannot invoke Task A. 

    Parameter Passing

    1. For versions earlier than 3.7.1:

    Parameter Passing is not set by default. If Pass Parameter in Current Task to Subtask is ticked, the defined task parameters and the parameters output by Parameter Assignment can be passed to the subtask for use.

    iconNote:

    1. If Pass Parameter in Current Task to Subtask is ticked, the parameters defined in the task can be used in the subtask, but the parameters output by Parameter Assignment can only be used in the first node in the subtask.

    2. Cross-level parameter passing is not supported. Parameters can only be passed to subtasks and cannot be passed to grandchild tasks.

    2. For 3.7.1 and later versions:

    Parameter Passing is not set by default. If Pass Parameter in Current Task to Subtask is ticked, the defined task parameters and the parameters output by Parameter Assignment can be passed to the subtask for use.

    iconNote:
    Cross-level parameter passing is supported.

    The page after you tick Pass Parameter in Current Task to Subtask is shown in the following figure.

    Parameter Assignment: It includes parameters output by the upstream Parameter Assignment node of the same branch of the Invocation Task node. Parameters output by Parameter Assignment can be used by all downstream nodes in the same branch. The cross-branch use is not supported.

    Task Parameter: It includes task parameters, all of which can be passed to subtasks.

    Description of the logic of cross-level parameter passing:

    You can only select and pass parameters defined in the current task to the subtask. To pass a parameter to a grandchild task, ensure that the parameter exists in both the parent task and the subtask and has been set to be passed to the subtask. 

    For example, Task C is the parent task of Task B, and Task B is the parent task of Task A. To use the p1 parameter in Task C in Task A, you must ensure a p1 parameter in Task B and set p1 in both Task C and Task B to be passed to the subtask.

    Log Description

    Logic

    Example

    For invocation tasks, only the execution result of the Invocation Task node is displayed. The detailed running log of the invoked task is not displayed on the parent task page.

    You can click View Log to be redirected to the invoked task page and view the detailed log.

    In the following example, after the task is run, the Log area only displays the execution result of the Invocation Task node.

    Click the View Log button to be redirected to the invoked task page and view the detailed log.

    Notes

    Parameter Name Conflict

    The parameter names in the subtask may be identical to the names of parameters passed from the parent task, causing conflicts. In this case, the priority of parameters with identical names in the subtask is as follows:

    1. For versions earlier than 3.7.1:

    In descending order: parameters output by Parameter Assignment, task parameters, parameters output by Parameter Assignment of the parent task, task parameter of the parent task, and system parameter

    2. For 3.7.1 and later versions:

    In descending order: parameters output by Parameter Assignment, parameters output by Parameter Assignment of the parent task, task parameter of the parent task, task parameters, and system parameter

    Task Scheduling Conflict

    Assume that both the parent task and the subtask are configured with a scheduling plan. If the subtask is running when you run the parent task, the subtask will be executed after the preceding execution is completed.

    When multiple parent tasks invoke the same subtask, the subtask will be executed multiple times in the order of invocation. The next execution starts after the former one is completed.

    附件列表


    主题: Data Development - Scheduled Task
    Previous
    Next
    • 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