[BUG][WORKER-9349]fix param priority (#9379)
* fix param priority * fix params priority code logicgit-as-svn/v1/dev
parent
f186b0d391
commit
2a4fa9cdb1
|
|
@ -75,15 +75,14 @@ public abstract class AbstractParameters implements IParameters {
|
|||
* @return parameters map
|
||||
*/
|
||||
public Map<String, Property> getLocalParametersMap() {
|
||||
Map<String, Property> localParametersMaps = new LinkedHashMap<>();
|
||||
if (localParams != null) {
|
||||
Map<String, Property> localParametersMaps = new LinkedHashMap<>();
|
||||
|
||||
for (Property property : localParams) {
|
||||
localParametersMaps.put(property.getProp(),property);
|
||||
}
|
||||
return localParametersMaps;
|
||||
}
|
||||
return null;
|
||||
return localParametersMaps;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -92,14 +91,13 @@ public abstract class AbstractParameters implements IParameters {
|
|||
* @return parameters map
|
||||
*/
|
||||
public Map<String, Property> getVarPoolMap() {
|
||||
Map<String, Property> varPoolMap = new LinkedHashMap<>();
|
||||
if (varPool != null) {
|
||||
Map<String, Property> varPoolMap = new LinkedHashMap<>();
|
||||
for (Property property : varPool) {
|
||||
varPoolMap.put(property.getProp(), property);
|
||||
}
|
||||
return varPoolMap;
|
||||
}
|
||||
return null;
|
||||
return varPoolMap;
|
||||
}
|
||||
|
||||
public List<Property> getVarPool() {
|
||||
|
|
|
|||
|
|
@ -63,9 +63,10 @@ public class ParamUtils {
|
|||
// combining local and global parameters
|
||||
Map<String, Property> localParams = parameters.getLocalParametersMap();
|
||||
|
||||
//stream pass params
|
||||
Map<String, Property> varParams = parameters.getVarPoolMap();
|
||||
|
||||
if (globalParams == null && localParams == null) {
|
||||
if (globalParams.size() == 0 && localParams.size() == 0 && varParams.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
// if it is a complement,
|
||||
|
|
@ -85,15 +86,13 @@ public class ParamUtils {
|
|||
}
|
||||
params.put(PARAMETER_TASK_INSTANCE_ID, Integer.toString(taskExecutionContext.getTaskInstanceId()));
|
||||
|
||||
if (globalParams != null && localParams != null) {
|
||||
if (varParams.size() != 0) {
|
||||
globalParams.putAll(varParams);
|
||||
}
|
||||
if (localParams.size() != 0) {
|
||||
globalParams.putAll(localParams);
|
||||
} else if (globalParams == null && localParams != null) {
|
||||
globalParams = localParams;
|
||||
}
|
||||
if (varParams != null) {
|
||||
varParams.putAll(globalParams);
|
||||
globalParams = varParams;
|
||||
}
|
||||
|
||||
Iterator<Map.Entry<String, Property>> iter = globalParams.entrySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
Map.Entry<String, Property> en = iter.next();
|
||||
|
|
@ -143,16 +142,15 @@ public class ParamUtils {
|
|||
* @return parameters map
|
||||
*/
|
||||
public static Map<String, Property> getUserDefParamsMap(Map<String, String> definedParams) {
|
||||
Map<String, Property> userDefParamsMaps = new HashMap<>();
|
||||
if (definedParams != null) {
|
||||
Map<String, Property> userDefParamsMaps = new HashMap<>();
|
||||
Iterator<Map.Entry<String, String>> iter = definedParams.entrySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
Map.Entry<String, String> en = iter.next();
|
||||
Property property = new Property(en.getKey(), Direct.IN, DataType.VARCHAR, en.getValue());
|
||||
userDefParamsMaps.put(property.getProp(),property);
|
||||
}
|
||||
return userDefParamsMaps;
|
||||
}
|
||||
return null;
|
||||
return userDefParamsMaps;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue