lenboo commented on a change in pull request #4555:
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/4555#discussion_r566557598
##########
File path:
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessInstanceService.java
##########
@@ -459,25 +458,29 @@ private void
addDependResultForTaskList(List<TaskInstance> taskInstanceList) thr
if (tenant != null) {
processInstance.setTenantCode(tenant.getTenantCode());
}
+ // get the processinstancejson before saving,and then save the
name and taskid
+ String oldJson = processInstance.getProcessInstanceJson();
+ if (StringUtils.isNotEmpty(oldJson)) {
+ processInstanceJson =
processService.changeJson(processData,oldJson);
+ }
processInstance.setProcessInstanceJson(processInstanceJson);
processInstance.setGlobalParams(globalParams);
}
int update = processService.updateProcessInstance(processInstance);
int updateDefine = 1;
- if (Boolean.TRUE.equals(syncDefine) &&
StringUtils.isNotEmpty(processInstanceJson)) {
- processDefinition.setProcessDefinitionJson(processInstanceJson);
- processDefinition.setGlobalParams(originDefParams);
- processDefinition.setLocations(locations);
- processDefinition.setConnects(connects);
- processDefinition.setTimeout(timeout);
- processDefinition.setUpdateTime(new Date());
-
- // add process definition version
- long version =
processDefinitionVersionService.addProcessDefinitionVersion(processDefinition);
- processDefinition.setVersion(version);
- updateDefine = processDefineMapper.updateById(processDefinition);
- }
+
Review comment:
' if (Boolean.TRUE.equals(syncDefine) &&
StringUtils.isNotEmpty(processInstanceJson))'
why remove the syncDefine judgement?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]