|
|
@ -23,6 +23,7 @@ import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.C |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_START_DATE; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_START_DATE; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_EMPTY_SUB_PROCESS; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_EMPTY_SUB_PROCESS; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_RECOVER_PROCESS_ID_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_PARAMS; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_SUB_PROCESS; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_SUB_PROCESS; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID; |
|
|
|
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID; |
|
|
@ -770,8 +771,9 @@ public class ProcessServiceImpl implements ProcessService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
CommandType commandTypeIfComplement = getCommandTypeIfComplement(processInstance, command); |
|
|
|
CommandType commandTypeIfComplement = getCommandTypeIfComplement(processInstance, command); |
|
|
|
// reset global params while repeat running is needed by cmdParam
|
|
|
|
// reset global params while repeat running and recover tolerance fault process is needed by cmdParam
|
|
|
|
if (commandTypeIfComplement == CommandType.REPEAT_RUNNING) { |
|
|
|
if (commandTypeIfComplement == CommandType.REPEAT_RUNNING || |
|
|
|
|
|
|
|
commandTypeIfComplement == CommandType.RECOVER_TOLERANCE_FAULT_PROCESS) { |
|
|
|
setGlobalParamIfCommanded(processDefinition, cmdParam); |
|
|
|
setGlobalParamIfCommanded(processDefinition, cmdParam); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1590,8 +1592,7 @@ public class ProcessServiceImpl implements ProcessService { |
|
|
|
cmd.setProcessDefinitionCode(processInstance.getProcessDefinitionCode()); |
|
|
|
cmd.setProcessDefinitionCode(processInstance.getProcessDefinitionCode()); |
|
|
|
cmd.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion()); |
|
|
|
cmd.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion()); |
|
|
|
cmd.setProcessInstanceId(processInstance.getId()); |
|
|
|
cmd.setProcessInstanceId(processInstance.getId()); |
|
|
|
cmd.setCommandParam( |
|
|
|
cmd.setCommandParam(JSONUtils.toJsonString(createCommandParams(processInstance))); |
|
|
|
String.format("{\"%s\":%d}", CMD_PARAM_RECOVER_PROCESS_ID_STRING, processInstance.getId())); |
|
|
|
|
|
|
|
cmd.setExecutorId(processInstance.getExecutorId()); |
|
|
|
cmd.setExecutorId(processInstance.getExecutorId()); |
|
|
|
cmd.setCommandType(CommandType.RECOVER_TOLERANCE_FAULT_PROCESS); |
|
|
|
cmd.setCommandType(CommandType.RECOVER_TOLERANCE_FAULT_PROCESS); |
|
|
|
cmd.setProcessInstancePriority(processInstance.getProcessInstancePriority()); |
|
|
|
cmd.setProcessInstancePriority(processInstance.getProcessInstancePriority()); |
|
|
@ -2605,4 +2606,15 @@ public class ProcessServiceImpl implements ProcessService { |
|
|
|
triggerRelationService.saveCommandTrigger(commandId, processInstanceId); |
|
|
|
triggerRelationService.saveCommandTrigger(commandId, processInstanceId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Map<String, Object> createCommandParams(ProcessInstance processInstance) { |
|
|
|
|
|
|
|
Map<String, Object> commandMap = |
|
|
|
|
|
|
|
JSONUtils.parseObject(processInstance.getCommandParam(), new TypeReference<Map<String, Object>>() { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
Map<String, Object> recoverFailoverCommandParams = new HashMap<>(); |
|
|
|
|
|
|
|
Optional.ofNullable(MapUtils.getObject(commandMap, CMD_PARAM_START_PARAMS)) |
|
|
|
|
|
|
|
.ifPresent(startParams -> recoverFailoverCommandParams.put(CMD_PARAM_START_PARAMS, startParams)); |
|
|
|
|
|
|
|
recoverFailoverCommandParams.put(CMD_PARAM_RECOVER_PROCESS_ID_STRING, processInstance.getId()); |
|
|
|
|
|
|
|
return recoverFailoverCommandParams; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|