Browse Source

fix the OUT direct param could pass to the current script (#9463)

3.0.0/version-upgrade
Tq 3 years ago committed by GitHub
parent
commit
04d4e4e0c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
  2. 2
      dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/ParamUtils.java

17
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; 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 * get varPool map
* *

2
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(); Date scheduleTime = taskExecutionContext.getScheduleTime();
// combining local and global parameters // combining local and global parameters
Map<String, Property> localParams = parameters.getLocalParametersMap(); Map<String, Property> localParams = parameters.getInputLocalParametersMap();
//stream pass params //stream pass params
Map<String, Property> varParams = parameters.getVarPoolMap(); Map<String, Property> varParams = parameters.getVarPoolMap();

Loading…
Cancel
Save