1.2 KiB
1.2 KiB
SWITCH Task development
Switch task workflow step as follows
- User-defined expressions and branch information are stored in
taskParamsintaskdefinition. When the switch is executed, it will be formatted asSwitchParameters SwitchTaskExecThreadprocesses the expressions defined inswitchfrom top to bottom, obtains the value of the variable fromvarPool, and parses the expression throughjavascript. If the expression returns true, stop checking and record The order of the expression, here we record as resultConditionLocation. The task of SwitchTaskExecThread is over- After the
switchtask runs, if there is no error (more commonly, the user-defined expression is out of specification or there is a problem with the parameter name), thenMasterExecThread.submitPostNodewill obtain the downstream node of theDAGto continue execution. - If it is found in
DagHelper.parsePostNodesthat the current node (the node that has just completed the work) is aswitchnode, theresultConditionLocationwill be obtained, and all branches exceptresultConditionLocationin the SwitchParameters will be skipped. In this way, only the branches that need to be executed are left