Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][WORKER-9349]fix param priority #9379

Merged
merged 2 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ private int createCommand(CommandType commandType, long processDefineCode,
* @param runMode
* @return
*/
private int createComplementCommandList(Date start, Date end, RunMode runMode, Command command,
protected int createComplementCommandList(Date start, Date end, RunMode runMode, Command command,
Integer expectedParallelismNumber, ComplementDependentMode complementDependentMode) {
int createCount = 0;
int dependentProcessDefinitionCreateCount = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,14 @@ public void setLocalParams(List<Property> localParams) {
* @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;
}

/**
Expand All @@ -92,14 +91,13 @@ public Map<String, Property> getLocalParametersMap() {
* @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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ public static Map<String, Property> convert(TaskExecutionContext taskExecutionCo
// 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,
Expand All @@ -85,15 +86,13 @@ public static Map<String, Property> convert(TaskExecutionContext taskExecutionCo
}
params.put(PARAMETER_TASK_INSTANCE_ID, Integer.toString(taskExecutionContext.getTaskInstanceId()));

if (globalParams != null && localParams != null) {
globalParams.putAll(localParams);
} else if (globalParams == null && localParams != null) {
globalParams = localParams;
if (varParams.size() != 0) {
globalParams.putAll(varParams);
}
if (varParams != null) {
varParams.putAll(globalParams);
globalParams = varParams;
if (localParams.size() != 0) {
globalParams.putAll(localParams);
}

Iterator<Map.Entry<String, Property>> iter = globalParams.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry<String, Property> en = iter.next();
Expand Down Expand Up @@ -143,16 +142,15 @@ public static Map<String,String> convert(Map<String,Property> paramsMap) {
* @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;
}
}