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

healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 15affd761 [INLONG-4766][Manager] Fix NP problem when the COMPLETE 
request is fired directly from the client (#4802)
15affd761 is described below

commit 15affd7613fcc1e4fd94f4383a4ada1ed014f230
Author: woofyzhao <[email protected]>
AuthorDate: Wed Jun 29 11:00:05 2022 +0800

    [INLONG-4766][Manager] Fix NP problem when the COMPLETE request is fired 
directly from the client (#4802)
---
 .../inlong/manager/workflow/processor/ServiceTaskProcessor.java      | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/inlong-manager/manager-workflow/src/main/java/org/apache/inlong/manager/workflow/processor/ServiceTaskProcessor.java
 
b/inlong-manager/manager-workflow/src/main/java/org/apache/inlong/manager/workflow/processor/ServiceTaskProcessor.java
index 73e58bd2b..84283e456 100644
--- 
a/inlong-manager/manager-workflow/src/main/java/org/apache/inlong/manager/workflow/processor/ServiceTaskProcessor.java
+++ 
b/inlong-manager/manager-workflow/src/main/java/org/apache/inlong/manager/workflow/processor/ServiceTaskProcessor.java
@@ -21,6 +21,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.ImmutableSet;
 import lombok.NoArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.inlong.manager.common.enums.TaskStatus;
 import org.apache.inlong.manager.common.exceptions.JsonException;
@@ -120,6 +121,10 @@ public class ServiceTaskProcessor extends 
AbstractTaskProcessor<ServiceTask> {
     }
 
     private void resetActionContext(WorkflowContext context) {
+        if (CollectionUtils.isEmpty(context.getNewTaskList())) {
+            // independent complete request when the action context is already 
built
+            return;
+        }
         context.setActionContext(
                 new WorkflowContext.ActionContext()
                         .setTask((WorkflowTask) context.getCurrentElement())

Reply via email to