Skip to content

Commit

Permalink
Fix bug duplicate predecessor tasks apache#16202
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoqisu777 authored Jun 24, 2024
1 parent 9a823c4 commit 0926ffa
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public Map<String, Object> createTaskBindsWorkFlow(User loginUser,
processTaskRelationLogList.add(processTaskRelationLog);
}
int insertResult = processService.saveTaskRelation(loginUser, projectCode, processDefinition.getCode(),
processDefinition.getVersion(),
processDefinition.getVersion()+1,
processTaskRelationLogList, Lists.newArrayList(), Boolean.TRUE);
if (insertResult != Constants.EXIT_CODE_SUCCESS) {
log.error(
Expand All @@ -400,6 +400,14 @@ public Map<String, Object> createTaskBindsWorkFlow(User loginUser,
} else
log.info("Save task definition complete, projectCode:{}, taskDefinitionCode:{}.", projectCode,
taskDefinition.getCode());

int insertVersion = processService.saveProcessDefine(loginUser, processDefinition, Boolean.TRUE, Boolean.TRUE);
if (insertVersion == 0) {
throw new ServiceException(Status.CREATE_PROCESS_DEFINITION_ERROR);
} else
log.info("Save process definition complete, processCode:{}, processVersion:{}.",
processDefinition.getCode(), insertVersion);

putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, taskDefinition);
return result;
Expand Down

0 comments on commit 0926ffa

Please sign in to comment.