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/08/18 14:06:40 UTC

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

ITBOX-ITBOY commented on code in PR #10184:
URL: https://github.com/apache/dolphinscheduler/pull/10184#discussion_r949178336


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-http/src/main/java/org/apache/dolphinscheduler/plugin/task/http/HttpParameters.java:
##########
@@ -130,4 +138,69 @@ public int getSocketTimeout() {
     public void setSocketTimeout(int socketTimeout) {
         this.socketTimeout = socketTimeout;
     }
+
+    @Override
+    public void dealOutParam(String result) {
+        if (CollectionUtils.isEmpty(localParams)) {
+            return;
+        }
+        List<Property> outProperty = getOutProperty(localParams);
+        if (CollectionUtils.isEmpty(outProperty)) {
+            return;
+        }
+        if (StringUtils.isEmpty(result)) {
+            varPool.addAll(outProperty);
+            return;
+        }
+        List<Map<String, String>> httpMapByString = getHttpMapByString(result);
+        if (httpMapByString == null || httpMapByString.size() == 0) {
+            return;
+        }
+
+        for (Property info : outProperty) {
+            for (int i = 0; i < httpMapByString.size() ; i++) {
+                Map<String, String> stringStringMap=httpMapByString.get(i);

Review Comment:
   The code has been processed and submitted



##########
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:
   The code has been processed and submitted



-- 
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