提交 ac9f5dc2 编写于 作者: L lgcareer

[fix-3843][api] When update workflow definition,if name already exists, the prompt is not friendly

上级 adda0eb4
......@@ -382,24 +382,25 @@ public class ProcessDefinitionService extends BaseDAGService {
return checkProcessJson;
}
ProcessDefinition processDefine = processService.findProcessDefineById(id);
if (!name.equals(processDefine.getName())) {
ProcessDefinition definition = processDefineMapper.verifyByDefineName(project.getId(), name);
if (definition != null) {
putMsg(result, Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR, name);
return result;
}
}
// check process definition exists
if (processDefine == null) {
// check process definition exists
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, id);
return result;
} else if (processDefine.getReleaseState() == ReleaseState.ONLINE) {
}
if (processDefine.getReleaseState() == ReleaseState.ONLINE) {
// online can not permit edit
putMsg(result, Status.PROCESS_DEFINE_NOT_ALLOWED_EDIT, processDefine.getName());
return result;
} else {
putMsg(result, Status.SUCCESS);
}
if (!name.equals(processDefine.getName())) {
// check whether the new process define name exist
ProcessDefinition definition = processDefineMapper.verifyByDefineName(project.getId(), name);
if (definition != null) {
putMsg(result, Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR, name);
return result;
}
}
Date now = new Date();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册