You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/13 02:22:14 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #10184: [Feature-10044][dolphinscheduler-task-http] Implements HTTP parameter passing to the next node

caishunfeng commented on code in PR #10184:
URL: https://github.com/apache/dolphinscheduler/pull/10184#discussion_r969078384


##########
docs/docs/en/guide/parameter/context.md:
##########
@@ -76,3 +76,21 @@ The result of Node_mysql is as follows:
 Even though output is assigned a value of 1 in Node_A's script, the log still shows a value of 100. But according to the principle from [parameter priority](priority.md): `Local Parameter > Parameter Context > Global Parameter`, the output value in Node_B is 1. It proves that the output parameter is passed in the workflow with reference to the expected value, and the query operation is completed using this value in Node_mysql.
 
 But the output value 66 only shows in the Node_A, the reason is that the direction of value is selected as IN, and only when the direction is OUT will it be defined as a variable output.
+
+### HTTP
+
+Step 1: Drag an HTTP task, fill IN body for KEY, select OUT for IN/OUT, select VARCHAR for output data type, always select VARCHAR, nothing else.
+
+![httpParam-1](../../../../img/httpParam/httpParam-1.png)
+
+Step 2: After adding an HTTP task type node, accept the parameters passed upstream. This time just add it in the Request Parameters section,
+
+![httpParam-2](../../../../img/httpParam/httpParam-2.png)
+
+It can be anything, it can be body, it can be anything, parameter,value, it must be the key that you pass upstream. In this case, the key that you pass upstream is body, so we use ${body}
+
+The configuration is complete
+![httpParam-3](../../../../img/httpParam/httpParam-3.png)
+
+Step 3: You can write a test interface to test whether our parameters are passed successfully.
+![httpParam-4](../../../../img/httpParam/httpParam-4.png)

Review Comment:
   I think we don't need this in doc, WDYT? cc @zhongjiajie 
   
   BTW, if add, it's better to use English log. 



##########
docs/docs/zh/guide/parameter/context.md:
##########
@@ -76,3 +77,22 @@ Node_mysql 运行结果如下:
 虽然在 Node_A 的脚本中为 output 赋值为 1,但日志中显示的值仍然为 100。但根据[参数优先级](priority.md)的原则:`本地参数 > 上游任务传递的参数 > 全局参数`,在 Node_B 中输出的值为 1。则证明 output 参数参照预期的值在该工作流中传递,并在 Node_mysql 中使用该值完成查询操作。
 
 但是 value 的值却只有在 Node_A 中输出为 66,其原因为 value 的方向选择为 IN,只有当方向为 OUT 时才会被定义为变量输出。
+
+
+### HTTP
+
+拖一个http类型的任务,在自定义参数中KEY的位置填写body,在IN/OUT的部分选择OUT,在输出数据类型部分选择VARCHAR,一定要选择VARCHAR,不要选择别的哈。

Review Comment:
   Documentation should avoid colloquialism.
   ```suggestion
   拖一个http类型的任务,在自定义参数中KEY的位置填写body,在IN/OUT的部分选择OUT,在输出数据类型部分选择VARCHAR(只能选择VARCHAR)。
   ```



##########
docs/docs/en/guide/parameter/context.md:
##########
@@ -76,3 +76,21 @@ The result of Node_mysql is as follows:
 Even though output is assigned a value of 1 in Node_A's script, the log still shows a value of 100. But according to the principle from [parameter priority](priority.md): `Local Parameter > Parameter Context > Global Parameter`, the output value in Node_B is 1. It proves that the output parameter is passed in the workflow with reference to the expected value, and the query operation is completed using this value in Node_mysql.
 
 But the output value 66 only shows in the Node_A, the reason is that the direction of value is selected as IN, and only when the direction is OUT will it be defined as a variable output.
+
+### HTTP
+
+Step 1: Drag an HTTP task, fill IN body for KEY, select OUT for IN/OUT, select VARCHAR for output data type, always select VARCHAR, nothing else.

Review Comment:
   If user can just select the `VARCHAR`, can it limit in UI?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org