Browse Source

[Improvement][API][num-5] The workflow of the main table version is not allowed to be deleted (#6893)

* feature:deleteProcessDefinitionVersion

* pref:delete duplicate enum definition

Co-authored-by: 北笙 <“zhanqian@cai-inc.com”>
3.0.0/version-upgrade
Jeff Zhan 3 years ago committed by GitHub
parent
commit
3101218c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java

@ -1509,6 +1509,10 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
if (processDefinition == null) {
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, code);
} else {
if (processDefinition.getVersion() == version) {
putMsg(result, Status.MAIN_TABLE_USING_VERSION);
return result;
}
int deleteLog = processDefinitionLogMapper.deleteByProcessDefinitionCodeAndVersion(code, version);
int deleteRelationLog = processTaskRelationLogMapper.deleteByCode(processDefinition.getCode(), processDefinition.getVersion());
if (deleteLog == 0 || deleteRelationLog == 0) {

Loading…
Cancel
Save