|
|
@ -346,7 +346,8 @@ public class ProcessInstanceService extends BaseDAGService { |
|
|
|
|
|
|
|
|
|
|
|
//check process instance status
|
|
|
|
//check process instance status
|
|
|
|
if (!processInstance.getState().typeIsFinished()) { |
|
|
|
if (!processInstance.getState().typeIsFinished()) { |
|
|
|
putMsg(result, Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR, "update"); |
|
|
|
putMsg(result, Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR, |
|
|
|
|
|
|
|
processInstance.getName(), processInstance.getState().toString(), "update"); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
Date schedule = null; |
|
|
|
Date schedule = null; |
|
|
@ -355,8 +356,12 @@ public class ProcessInstanceService extends BaseDAGService { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
schedule = processInstance.getScheduleTime(); |
|
|
|
schedule = processInstance.getScheduleTime(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
processInstance.setScheduleTime(schedule); |
|
|
|
|
|
|
|
processInstance.setLocations(locations); |
|
|
|
|
|
|
|
processInstance.setConnects(connects); |
|
|
|
String globalParams = null; |
|
|
|
String globalParams = null; |
|
|
|
String originDefParams = null; |
|
|
|
String originDefParams = null; |
|
|
|
|
|
|
|
int timeout = processInstance.getTimeout(); |
|
|
|
if (StringUtils.isNotEmpty(processInstanceJson)) { |
|
|
|
if (StringUtils.isNotEmpty(processInstanceJson)) { |
|
|
|
ProcessData processData = JSONUtils.parseObject(processInstanceJson, ProcessData.class); |
|
|
|
ProcessData processData = JSONUtils.parseObject(processInstanceJson, ProcessData.class); |
|
|
|
//check workflow json is valid
|
|
|
|
//check workflow json is valid
|
|
|
@ -370,9 +375,14 @@ public class ProcessInstanceService extends BaseDAGService { |
|
|
|
Map<String, String> globalParamMap = globalParamList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); |
|
|
|
Map<String, String> globalParamMap = globalParamList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); |
|
|
|
globalParams = ParameterUtils.curingGlobalParams(globalParamMap, globalParamList, |
|
|
|
globalParams = ParameterUtils.curingGlobalParams(globalParamMap, globalParamList, |
|
|
|
processInstance.getCmdTypeIfComplement(), schedule); |
|
|
|
processInstance.getCmdTypeIfComplement(), schedule); |
|
|
|
} |
|
|
|
timeout = processData.getTimeout(); |
|
|
|
int update = processDao.updateProcessInstance(processInstanceId, processInstanceJson, |
|
|
|
processInstance.setTimeout(timeout); |
|
|
|
globalParams, schedule, flag, locations, connects); |
|
|
|
processInstance.setProcessInstanceJson(processInstanceJson); |
|
|
|
|
|
|
|
processInstance.setGlobalParams(globalParams); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// int update = processDao.updateProcessInstance(processInstanceId, processInstanceJson,
|
|
|
|
|
|
|
|
// globalParams, schedule, flag, locations, connects);
|
|
|
|
|
|
|
|
int update = processDao.updateProcessInstance(processInstance); |
|
|
|
int updateDefine = 1; |
|
|
|
int updateDefine = 1; |
|
|
|
if (syncDefine && StringUtils.isNotEmpty(processInstanceJson)) { |
|
|
|
if (syncDefine && StringUtils.isNotEmpty(processInstanceJson)) { |
|
|
|
ProcessDefinition processDefinition = processDao.findProcessDefineById(processInstance.getProcessDefinitionId()); |
|
|
|
ProcessDefinition processDefinition = processDao.findProcessDefineById(processInstance.getProcessDefinitionId()); |
|
|
@ -380,6 +390,7 @@ public class ProcessInstanceService extends BaseDAGService { |
|
|
|
processDefinition.setGlobalParams(originDefParams); |
|
|
|
processDefinition.setGlobalParams(originDefParams); |
|
|
|
processDefinition.setLocations(locations); |
|
|
|
processDefinition.setLocations(locations); |
|
|
|
processDefinition.setConnects(connects); |
|
|
|
processDefinition.setConnects(connects); |
|
|
|
|
|
|
|
processDefinition.setTimeout(timeout); |
|
|
|
updateDefine = processDefineMapper.update(processDefinition); |
|
|
|
updateDefine = processDefineMapper.update(processDefinition); |
|
|
|
} |
|
|
|
} |
|
|
|
if (update > 0 && updateDefine > 0) { |
|
|
|
if (update > 0 && updateDefine > 0) { |
|
|
|