This is an automated email from the ASF dual-hosted git repository.

leonbao 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 99f593c  fix 6320 batch delete process definition bug (#6321)
99f593c is described below

commit 99f593cf42d6abd4312c74511f60ac8a2eeafb25
Author: JinYong Li <[email protected]>
AuthorDate: Thu Sep 23 22:43:15 2021 +0800

    fix 6320 batch delete process definition bug (#6321)
    
    Co-authored-by: JinyLeeChina <[email protected]>
---
 .../api/service/impl/ProcessDefinitionServiceImpl.java                | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 164565e..1812197 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
@@ -650,7 +650,7 @@ public class ProcessDefinitionServiceImpl extends 
BaseServiceImpl implements Pro
 
         int delete = 
processDefinitionMapper.deleteById(processDefinition.getId());
         int deleteRelation = 
processTaskRelationMapper.deleteByCode(project.getCode(), 
processDefinition.getCode());
-        if ((delete & deleteRelation) == 0) {
+        if (delete == 0 || deleteRelation == 0) {
             putMsg(result, Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR);
             throw new 
ServiceException(Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR);
         }
@@ -1476,7 +1476,7 @@ public class ProcessDefinitionServiceImpl extends 
BaseServiceImpl implements Pro
         } else {
             int deleteLog = 
processDefinitionLogMapper.deleteByProcessDefinitionCodeAndVersion(code, 
version);
             int deleteRelationLog = 
processTaskRelationLogMapper.deleteByCode(processDefinition.getCode(), 
processDefinition.getVersion());
-            if ((deleteLog & deleteRelationLog) == 0) {
+            if (deleteLog == 0 || deleteRelationLog == 0) {
                 putMsg(result, Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR);
                 throw new 
ServiceException(Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR);
             }

Reply via email to