You want to customize the error-handling process when a scheduled task fails. For example, you may want FineDataLink to send notifications to the WeCom group when a scheduled task fails.
The following figure explains the function.
The node at the start of the connector is the upstream node, and the node at the end of the connector is the downstream node.
Right-click a connector on the scheduled task editing page and configure the execution condition, with options including Execute Unconditionally, Execute on Success, and Execute on Failure provided, as shown in the following figure.
The following table describes the details.
Execute Unconditionally
The downstream node is executed regardless of whether the upstream node succeeds or fails.
Execute on Success
The downstream node is executed when the upstream node succeeds.
Execute on Failure
The downstream node is executed when the upstream node fails.
Right-click a node on the scheduled task editing page and click Execution Judgment. You can customize how multiple execution conditions take effect (All or Any) to control node dependencies in the task flexibly, as shown in the following figure.
When a downstream node is connected to multiple upstream nodes, click Execution Judgment and select All or Any from the dropdown list. The two options correspond to AND logic and OR logic, respectively.
AND logic: The execution of the downstream node is triggered only when the execution results of all upstream nodes meet the execution condition of the connectors.
OR logic: The execution of the downstream node is triggered when the execution result of any upstream node meets the execution condition of the connector. (The judgment condition is configured at the downstream node.)
1. When a downstream node is connected to an upstream node, the execution of the downstream node is triggered if the execution result of the upstream node meets the execution condition of the connector between them.
2. When a downstream node is connected to multiple upstream nodes, the execution judgment is triggered after all upstream nodes complete execution, and the execution of the downstream node follows the selected logic:
3. The downstream node of a Conditional Branch node only allows setting Execution Judgment to Execute on Success. Execute on Failure and Execute Unconditionally are grayed out and cannot be selected.
If the execution condition of the connector is set to Execute on Success and the execution result of the Conditional Branch node meets the configured judgment condition, the execution of the corresponding downstream node will be triggered.
If the execution condition of the connector is Execute on Success, but the execution result of the Conditional Branch node does not meet the configured judgment condition, the downstream node will skip execution.
4. The Execution Judgment of an upstream Virtual Node is Execute on Success by default. Execute on Failure and Execute Unconditionally are grayed out and cannot be selected. Once triggered, the execution of a Virtual Node is always successful.
The following figure shows the design of a scheduled task.
Nodes A, B, C, and D form a 1-to-N scenario. The following table describes their execution strategies.
The execution fails.
The execution is not triggered.
The execution is triggered.
The execution succeeds.
The execution is terminated.
For example, you stop the task when Node A starts execution.
The execution is skipped. For example:
1. The upstream node of Node A is not a Conditional Branch node, and the execution result of the upstream node does not meet the execution condition of the connector between the two nodes.
2. The upstream node of Node A is a Conditional Branch node, and it determines to skip Node A after a conditional judgment.
The following figure shows the design of an ETL task.
Nodes A, B, C, and D form an N-to-1 scenario. The following table describes their execution strategies.
1. Nodes A, B, and C are not Conditional Branch nodes. The execution judgment on Node D is triggered after all its upstream nodes complete execution.
2. Regardless of how many upstream nodes are connected to Node D, or what execution judgment is configured for their connectors, Node D will only be executed once during each task execution.
AND
The execution results of nodes A, B, and C all meet the execution conditions configured at Node D.
Any of the execution results of nodes A, B, or C does not meet the execution conditions configured at Node D.
OR
Any of the execution results of nodes A, B, or C meet the execution conditions configured at Node D.
None of the execution results of nodes A, B, and C meet the execution conditions configured at Node D.
Scenario: Node H will be executed if at least one upstream chain (A-D, B-E, or C-F) succeeds, as shown in the following figure.
If you want Node H to be executed only after nodes D, E, and F are all executed successfully, you can use the following methods.
Method One: Add a Conditional Branch node before Node H and reference the parameter Node Name.opresult (whose output value is success if the node is executed successfully) to determine whether to execute Node H.
Method Two: Set the logic for multiple execution conditions to take effect to All at Node H, as shown in the following figure. For details, see the "Execution Judgment Introduction" section.
The execution condition of connectors in chains A-C, A-D, B-C, and B-D is set to Execute on Success, Execute on Failure, Execute on Success, and Execute on Failure, respectively. Multiple conditions are evaluated with AND logic, as shown in the following figure.
Execution strategy: When both Node A and Node B succeed, Node C will be executed and Node D will not be executed. When both Node A and Node B fail, Node D will be executed and Node C will not be executed. When Node A succeeds and Node B fails, neither Node C nor Node D will be executed.
By default, the execution condition on all node connectors is set to Execute on Success, and multiple execution conditions are evaluated with AND.
Example: If the upstream node runs successfully, its downstream node will be executed. If the upstream node fails to run, the system will send a notification message.
1. Create a scheduled task, drag in a Data Synchronization node, name it Data Extraction from the Sales Table, set Data Source to Sales, and extract all data of the North China region in the table. Next, configure Data Destination and Mapping. To store the extracted data in a new table, set Target Table to Auto Created Table and name the table Sale, as shown in the following figure.
2. Add an SQL Script node, connect it to the Data Synchronization node, and name it Sales_Sum. Select SQLite as the data source, choose FDLDemo as the data connection, and enter the SQL statement to create the Sales_Sum table, as shown in the following figure.
CREATE TABLE `Sales_Sum` ( `Area` TEXT DEFAULT NULL, `Salesman` TEXT DEFAULT NULL, `Sales` REAL DEFAULT NULL);
3. Add another SQL Script node, connect it to the Sales_Sum node, and name it Data Filtering. Select SQLite as the data source, choose FDLDemo as the data connection, and enter the SQL statement to insert data with sales volume greater than 600 from Sale into Sales_Sum, as shown in the following figure.
INSERT INTO `Sales_Sum` (Area, Salesman, Sales)SELECT Area, Name, Sales FROM `Sale` WHERE Sales > 600;
1. Add a Notification node and connect it to the Sales_Sum node.
2. Right-click the connector between the Notification node and the Sales_Sum node, and click Execute on Failure, as shown in the following figure.
3. The following figure shows the setting page of the Notification node.
Click Run in the upper left corner, as shown in the following figure.
The Sales_Sum node is then executed successfully, and the Notification node is skipped.
Two tables are generated in the SQLite database:
Sale:
Sales_Sum:
1. Modify the SQL statement in the Sales_Sum node to make it invalid, as shown in the following figure.
2. Click Run in the upper-left corner, as shown in the following figure.
The Sales_Sum node fails to run, and the Notification node runs successfully.
In the WeCom group, the notification message is sent to the set group members, as shown in the following figure.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy