|
|
|
@ -20,7 +20,6 @@ package org.apache.dolphinscheduler.server.master.runner;
|
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_END_DATE; |
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST; |
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_START_DATE; |
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_FATHER_PARAMS; |
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_RECOVERY_START_NODE_STRING; |
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; |
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_START_NODES; |
|
|
|
@ -29,8 +28,6 @@ import static org.apache.dolphinscheduler.common.constants.Constants.COMMA;
|
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.Constants.DEFAULT_WORKER_GROUP; |
|
|
|
|
import static org.apache.dolphinscheduler.common.constants.DateConstants.YYYY_MM_DD_HH_MM_SS; |
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_BLOCKING; |
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.enums.DataType.VARCHAR; |
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.enums.Direct.IN; |
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.constants.Constants; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.CommandType; |
|
|
|
@ -860,7 +857,7 @@ public class WorkflowExecuteRunnable implements IWorkflowExecuteRunnable {
|
|
|
|
|
Map<String, String> cmdParam = JSONUtils.toMap(workflowInstance.getCommandParam()); |
|
|
|
|
if (cmdParam != null) { |
|
|
|
|
// reset global params while there are start parameters
|
|
|
|
|
setGlobalParamIfCommanded(workflowDefinition, cmdParam); |
|
|
|
|
processService.setGlobalParamIfCommanded(workflowDefinition, cmdParam); |
|
|
|
|
|
|
|
|
|
Date start = null; |
|
|
|
|
Date end = null; |
|
|
|
@ -2057,40 +2054,6 @@ public class WorkflowExecuteRunnable implements IWorkflowExecuteRunnable {
|
|
|
|
|
return waitToRetryTaskInstanceMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setGlobalParamIfCommanded(ProcessDefinition processDefinition, Map<String, String> cmdParam) { |
|
|
|
|
// get start params from command param
|
|
|
|
|
Map<String, String> startParamMap = new HashMap<>(); |
|
|
|
|
if (cmdParam.containsKey(CMD_PARAM_START_PARAMS)) { |
|
|
|
|
String startParamJson = cmdParam.get(CMD_PARAM_START_PARAMS); |
|
|
|
|
startParamMap = JSONUtils.toMap(startParamJson); |
|
|
|
|
} |
|
|
|
|
Map<String, String> fatherParamMap = new HashMap<>(); |
|
|
|
|
if (cmdParam.containsKey(CMD_PARAM_FATHER_PARAMS)) { |
|
|
|
|
String fatherParamJson = cmdParam.get(CMD_PARAM_FATHER_PARAMS); |
|
|
|
|
fatherParamMap = JSONUtils.toMap(fatherParamJson); |
|
|
|
|
} |
|
|
|
|
startParamMap.putAll(fatherParamMap); |
|
|
|
|
// set start param into global params
|
|
|
|
|
Map<String, String> globalMap = processDefinition.getGlobalParamMap(); |
|
|
|
|
List<Property> globalParamList = processDefinition.getGlobalParamList(); |
|
|
|
|
if (startParamMap.size() > 0 && globalMap != null) { |
|
|
|
|
// start param to overwrite global param
|
|
|
|
|
for (Map.Entry<String, String> param : globalMap.entrySet()) { |
|
|
|
|
String val = startParamMap.get(param.getKey()); |
|
|
|
|
if (val != null) { |
|
|
|
|
param.setValue(val); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// start param to create new global param if global not exist
|
|
|
|
|
for (Map.Entry<String, String> startParam : startParamMap.entrySet()) { |
|
|
|
|
if (!globalMap.containsKey(startParam.getKey())) { |
|
|
|
|
globalMap.put(startParam.getKey(), startParam.getValue()); |
|
|
|
|
globalParamList.add(new Property(startParam.getKey(), IN, VARCHAR, startParam.getValue())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* clear related data if command of process instance is EXECUTE_TASK |
|
|
|
|
* 1. find all task code from sub dag (only contains related task) |
|
|
|
|