From 652d690976aadff7519cf76664cd36f0e7a67cc3 Mon Sep 17 00:00:00 2001 From: ououtt <734164350@qq.com> Date: Mon, 27 Sep 2021 00:30:59 +0800 Subject: [PATCH] [DS-6362][fix] fix switch process definition version failed (#6363) --- .../api/service/impl/ProcessDefinitionServiceImpl.java | 2 +- .../apache/dolphinscheduler/service/process/ProcessService.java | 2 +- 2 files 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 ba467f0ae4..fc2a2ac5ab 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 @@ -1395,7 +1395,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro return result; } int switchVersion = processService.switchVersion(processDefinition, processDefinitionLog); - if (switchVersion > 0) { + if (switchVersion <= 0) { putMsg(result, Status.SWITCH_PROCESS_DEFINITION_VERSION_ERROR); throw new ServiceException(Status.SWITCH_PROCESS_DEFINITION_VERSION_ERROR); } diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java index cbd4f387fb..c1e392b758 100644 --- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java +++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java @@ -2212,7 +2212,7 @@ public class ProcessService { int result = processDefineMapper.updateById(processDefinitionLog); if (result > 0) { - result = switchProcessTaskRelationVersion(processDefinition); + result = switchProcessTaskRelationVersion(processDefinitionLog); if (result <= 0) { return Constants.DEFINITION_FAILURE; }