You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ca...@apache.org on 2022/04/13 02:43:20 UTC
[dolphinscheduler] branch dev updated: fix the OUT direct param could pass to the current script (#9463)
This is an automated email from the ASF dual-hosted git repository.
caishunfeng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 04d4e4e0c4 fix the OUT direct param could pass to the current script (#9463)
04d4e4e0c4 is described below
commit 04d4e4e0c4912ccdbbe8aa857af95dcc397e9e4e
Author: Tq <ti...@gmail.com>
AuthorDate: Wed Apr 13 10:43:12 2022 +0800
fix the OUT direct param could pass to the current script (#9463)
---
.../plugin/task/api/parameters/AbstractParameters.java | 17 +++++++++++++++++
.../plugin/task/api/parser/ParamUtils.java | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
index c556925f90..4a7f1c83ca 100644
--- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
@@ -84,6 +84,23 @@ public abstract class AbstractParameters implements IParameters {
return localParametersMaps;
}
+ /**
+ * get input local parameters map if the param direct is IN
+ * @return parameters map
+ */
+ public Map<String, Property> getInputLocalParametersMap() {
+ Map<String, Property> localParametersMaps = new LinkedHashMap<>();
+ if (localParams != null) {
+
+ for (Property property : localParams) {
+ if (property.getDirect().equals(Direct.IN)) {
+ localParametersMaps.put(property.getProp(), property);
+ }
+ }
+ }
+ return localParametersMaps;
+ }
+
/**
* get varPool map
*
diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParamUtils.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParamUtils.java
index 415bab633a..a59e1bf28d 100644
--- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParamUtils.java
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParamUtils.java
@@ -61,7 +61,7 @@ public class ParamUtils {
Date scheduleTime = taskExecutionContext.getScheduleTime();
// combining local and global parameters
- Map<String, Property> localParams = parameters.getLocalParametersMap();
+ Map<String, Property> localParams = parameters.getInputLocalParametersMap();
//stream pass params
Map<String, Property> varParams = parameters.getVarPoolMap();