This is an automated email from the ASF dual-hosted git repository.
jinyleechina pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 3101218 [Improvement][API][num-5] The workflow of the main table
version is not allowed to be deleted (#6893)
3101218 is described below
commit 3101218c73e3b0912fc3f670afb52422525e9fb9
Author: Jeff Zhan <[email protected]>
AuthorDate: Thu Nov 18 14:30:58 2021 +0800
[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: åįŽ <â[email protected]â>
---
.../api/service/impl/ProcessDefinitionServiceImpl.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
index 47fde6f..ae1faf2 100644
---
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
+++
b/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) {