|
|
|
@ -23,11 +23,15 @@ import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVERY_ST
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_START_NODES; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.DEFAULT_WORKER_GROUP; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.SEC_2_MINUTES_TIME_UNIT; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.START_UP_PARAMS_PREFIX; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.GLOBAL_PARAMS_PREFIX; |
|
|
|
|
import static org.apache.dolphinscheduler.common.enums.DataType.VARCHAR; |
|
|
|
|
import static org.apache.dolphinscheduler.common.enums.Direct.IN; |
|
|
|
|
|
|
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.CommandType; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.DependResult; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.Direct; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.ExecutionStatus; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.FailureStrategy; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.Flag; |
|
|
|
@ -688,6 +692,9 @@ public class WorkflowExecuteThread implements Runnable {
|
|
|
|
|
if (processInstance.isComplementData() && complementListDate.size() == 0) { |
|
|
|
|
Map<String, String> cmdParam = JSONUtils.toMap(processInstance.getCommandParam()); |
|
|
|
|
if (cmdParam != null && cmdParam.containsKey(CMDPARAM_COMPLEMENT_DATA_START_DATE)) { |
|
|
|
|
// reset global params while there are start parameters
|
|
|
|
|
setGlobalParamIfCommanded(processDefinition, cmdParam); |
|
|
|
|
|
|
|
|
|
Date start = DateUtils.stringToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE)); |
|
|
|
|
Date end = DateUtils.stringToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE)); |
|
|
|
|
List<Schedule> schedules = processService.queryReleaseSchedulerListByProcessDefinitionCode(processInstance.getProcessDefinitionCode()); |
|
|
|
@ -944,7 +951,7 @@ public class WorkflowExecuteThread implements Runnable {
|
|
|
|
|
|
|
|
|
|
private void setVarPoolValue(Map<String, Property> allProperty, Map<String, TaskInstance> allTaskInstance, TaskInstance preTaskInstance, Property thisProperty) { |
|
|
|
|
//for this taskInstance all the param in this part is IN.
|
|
|
|
|
thisProperty.setDirect(Direct.IN); |
|
|
|
|
thisProperty.setDirect(IN); |
|
|
|
|
//get the pre taskInstance Property's name
|
|
|
|
|
String proName = thisProperty.getProp(); |
|
|
|
|
//if the Previous nodes have the Property of same name
|
|
|
|
@ -1629,4 +1636,36 @@ public class WorkflowExecuteThread implements Runnable {
|
|
|
|
|
public Map<Integer, ITaskProcessor> getActiveTaskProcessorMaps() { |
|
|
|
|
return activeTaskProcessorMaps; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setGlobalParamIfCommanded(ProcessDefinition processDefinition, Map<String, String> cmdParam) { |
|
|
|
|
// get start params from command param
|
|
|
|
|
Map<String, String> startParamMap = new HashMap<>(); |
|
|
|
|
if (cmdParam.containsKey(Constants.CMD_PARAM_START_PARAMS)) { |
|
|
|
|
String startParamJson = cmdParam.get(Constants.CMD_PARAM_START_PARAMS); |
|
|
|
|
startParamMap = JSONUtils.toMap(startParamJson); |
|
|
|
|
} |
|
|
|
|
Map<String, String> fatherParamMap = new HashMap<>(); |
|
|
|
|
if (cmdParam.containsKey(Constants.CMD_PARAM_FATHER_PARAMS)) { |
|
|
|
|
String fatherParamJson = cmdParam.get(Constants.CMD_PARAM_FATHER_PARAMS); |
|
|
|
|
fatherParamMap = JSONUtils.toMap(fatherParamJson); |
|
|
|
|
} |
|
|
|
|
startParamMap.putAll(fatherParamMap); |
|
|
|
|
Map<String, String> globalMap = processDefinition.getGlobalParamMap(); |
|
|
|
|
List<Property> globalParamList = processDefinition.getGlobalParamList(); |
|
|
|
|
if (MapUtils.isNotEmpty(startParamMap) && globalMap != null) { |
|
|
|
|
Map<String, String> tempGlobalMap = new HashMap<>(); |
|
|
|
|
// add prefix for global params
|
|
|
|
|
for (Map.Entry<String, String> param : globalMap.entrySet()) { |
|
|
|
|
tempGlobalMap.put(GLOBAL_PARAMS_PREFIX+ param.getKey(), param.getValue()); |
|
|
|
|
} |
|
|
|
|
globalParamList.forEach(property -> property.setProp(GLOBAL_PARAMS_PREFIX + property.getProp())); |
|
|
|
|
// set start param into global params, add prefix for startup params
|
|
|
|
|
for (Entry<String, String> startParam : startParamMap.entrySet()) { |
|
|
|
|
String tmpStartParamKey = START_UP_PARAMS_PREFIX + startParam.getKey(); |
|
|
|
|
tempGlobalMap.put(tmpStartParamKey, startParam.getValue()); |
|
|
|
|
globalParamList.add(new Property(tmpStartParamKey, IN, VARCHAR, startParam.getValue())); |
|
|
|
|
} |
|
|
|
|
processDefinition.setGlobalParamMap(tempGlobalMap); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|