|
|
@ -17,6 +17,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.service.expand; |
|
|
|
package org.apache.dolphinscheduler.service.expand; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static java.util.Objects.nonNull; |
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.PARAMETER_PROJECT_CODE; |
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.PARAMETER_PROJECT_CODE; |
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.PARAMETER_PROJECT_NAME; |
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.PARAMETER_PROJECT_NAME; |
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.PARAMETER_TASK_DEFINITION_CODE; |
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.PARAMETER_TASK_DEFINITION_CODE; |
|
|
@ -69,8 +70,13 @@ public class CuringParamsServiceImpl implements CuringParamsService { |
|
|
|
private ProjectParameterMapper projectParameterMapper; |
|
|
|
private ProjectParameterMapper projectParameterMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String convertParameterPlaceholders(String val, Map<String, String> allParamMap) { |
|
|
|
public String convertParameterPlaceholders(String val, Map<String, Property> allParamMap) { |
|
|
|
return ParameterUtils.convertParameterPlaceholders(val, allParamMap); |
|
|
|
Map<String, String> paramMap = allParamMap |
|
|
|
|
|
|
|
.entrySet() |
|
|
|
|
|
|
|
.stream() |
|
|
|
|
|
|
|
.filter(entry -> nonNull(entry.getValue().getValue())) |
|
|
|
|
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().getValue())); |
|
|
|
|
|
|
|
return ParameterUtils.convertParameterPlaceholders(val, paramMap); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -212,6 +218,10 @@ public class CuringParamsServiceImpl implements CuringParamsService { |
|
|
|
// whether external scaling calculation is required
|
|
|
|
// whether external scaling calculation is required
|
|
|
|
if (timeFunctionNeedExpand(val)) { |
|
|
|
if (timeFunctionNeedExpand(val)) { |
|
|
|
val = timeFunctionExtension(taskInstance.getProcessInstanceId(), timeZone, val); |
|
|
|
val = timeFunctionExtension(taskInstance.getProcessInstanceId(), timeZone, val); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// handle some chain parameter assign, such as `{"var1": "${var2}", "var2": 1}` should be convert to
|
|
|
|
|
|
|
|
// `{"var1": 1, "var2": 1}`
|
|
|
|
|
|
|
|
val = convertParameterPlaceholders(val, prepareParamsMap); |
|
|
|
} |
|
|
|
} |
|
|
|
property.setValue(val); |
|
|
|
property.setValue(val); |
|
|
|
} |
|
|
|
} |
|
|
|