Skip to content

Commit 55dde4a

Browse files
author
苏义超
committed
add params pass for switch
1 parent 0dd9e7b commit 55dde4a

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

docs/docs/en/guide/parameter/context.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ DolphinScheduler allows parameter transfer between tasks. Currently, transfer di
1616
* [Python](../task/python.md)
1717
* [SubWorkflow](../task/sub-workflow.md)
1818
* [Kubernetes](../task/kubernetes.md)
19-
* [zeppelin](../task/zeppelin.md)
19+
* [Zeppelin](../task/zeppelin.md)
20+
* [Http](../task/http.md)
2021

2122
When defining an upstream node, if there is a need to transmit the result of that node to a dependency related downstream node. You need to set an `OUT` direction parameter to [Custom Parameters] of the [Current Node Settings]. If it is a sub-workflow node, there is no need to set a parameter in [Current Node Settings], but an `OUT` direction parameter needs to be set in the workflow definition of the sub-workflow.
2223

@@ -27,8 +28,9 @@ Upstream parameter will be override when defining parameter with the same name i
2728
> Note:
2829
>
2930
> 1. Parameter passing behavior has changed in version 3.3.x**
30-
> In legacy versions (3.2.2 and earlier), downstream node B could obtain the out type output X of upstream node A without configuring an IN type local variable X.
31-
> In new versions (3.3.0 and later), the logic for obtaining local variables has been modified: downstream node B can only use the out type output X of upstream node A if it has configured an IN type local variable X.(Note: This restriction does not apply to Switch tasks, as they lack an interface for configuring custom parameters.)
31+
> In legacy versions (3.2.2 and earlier), downstream node B could obtain the OUT type output X of upstream node A without configuring an IN type local variable X.
32+
> In new versions (3.3.0 and later), the logic for obtaining local variables has been modified: downstream node B can only use the OUT type output X of upstream node A if it has configured an IN type local variable X.
33+
> In all versions, for Switch nodes, there is no need to configure an IN type local variable X; you can directly use the OUT type output X from the upstream node A.
3234
> See the Node_B and Node_mysql examples below for details.
3335
>
3436
> 2. If there are no dependencies between nodes, local parameters cannot be passed upstream.

docs/docs/en/guide/task/switch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ The switch task needs to be connected with the downstream task to configure the
4040

4141
Configure the conditions and default branches. If the conditions are met, the specified branch will be taken. If the conditions are not met, the default branch will be taken.
4242
In the figure, if the value of the variable is "A", the branch taskA is executed, if the value of the variable is "B", the branch taskB is executed, and default is executed if both are not satisfied.
43+
Since the switch task type does not support configuring custom parameters, there is no need to define an IN-type local variable X. You can directly use the OUT-type output X from the upstream node. For more details, please refer to [Parameter Context](../parameter/context.md).
4344

4445
![switch_02](../../../../img/tasks/demo/switch_02.png)
4546

docs/docs/zh/guide/parameter/context.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ DolphinScheduler 允许在任务间进行参数传递,目前传递方向仅支
1616
* [Python](../task/python.md)
1717
* [SubWorkflow](../task/sub-workflow.md)
1818
* [Kubernetes](../task/kubernetes.md)
19-
* [zeppelin](../task/zeppelin.md)
19+
* [Zeppelin](../task/zeppelin.md)
20+
* [Http](../task/http.md)
2021

2122
当定义上游节点时,如果有需要将该节点的结果传递给有依赖关系的下游节点,需要在【当前节点设置】的【自定义参数】设置一个方向是 OUT 的变量。如果是 SubWorkflow 节点无需在【当前节点设置】中设置变量,需要在子流程的工作流定义中设置一个方向是 OUT 的变量。
2223

@@ -25,8 +26,9 @@ DolphinScheduler 允许在任务间进行参数传递,目前传递方向仅支
2526
如果定义了同名的传递参数,上游节点的参数将被覆盖。
2627

2728
> 1. 参数传递的行为在3.3.x版本中发生了变化**
28-
> 在旧版本(≤ 3.2.2)中,下游节点B无需配置IN类型局部变量X即可获取上游节点A的out类型输出X;
29-
> 新版本(≥ 3.3.0)中修改了局部变量的获取逻辑:只有下游节点B配置了IN类型的局部变量X,才可使用上游节点A的out类型输出X。(例外情况:Switch类型任务不受此限制。由于该任务类型不支持配置自定义参数(无输入参数配置入口),因此无需定义 IN 变量即可直接获取上游输出。)
29+
> 在旧版本(≤ 3.2.2)中,下游节点B无需配置IN类型局部变量X即可获取上游节点A的OUT类型输出X;
30+
> 新版本(≥ 3.3.0)中修改了局部变量的获取逻辑:只有下游节点B配置了IN类型的局部变量X,才可使用上游节点A的OUT类型输出X。
31+
> 所有版本中,如果是 Switch 节点都无需配置IN类型的局部变量X,即可直接使用上游节点A的OUT类型输出X。
3032
> 详情参考下文的Node_B 和 Node_mysql 样例
3133
>
3234
> 2. 若节点之间没有依赖关系,则局部参数无法通过上游传递。

docs/docs/zh/guide/task/switch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ switch 任务需要和下游任务连线配置关系后,才可以进行下游
3636

3737
配置条件和默认分支,满足条件会走指定分支,都不满足则走默认分支。
3838
图中如果变量的值为 "A" 则执行分支 taskA,如果变量的值为 "B" 则执行分支 taskB ,都不满足则执行 default。
39+
由于switch任务类型不支持配置自定义参数,因此无需配置IN类型的局部变量X,即可直接使用上游节点的OUT类型输出X,请参考[参数传递](../parameter/context.md)
3940

4041
![switch_02](../../../../img/tasks/demo/switch_02.png)
4142

0 commit comments

Comments
 (0)