From 503d54aff9dcecb1cf7023fd5850f84d985ac1ec Mon Sep 17 00:00:00 2001 From: Kerwin <37063904+zhuangchong@users.noreply.github.com> Date: Thu, 18 May 2023 19:24:53 +0800 Subject: [PATCH] Fix dependent task nodes in workflow instances cannot display data (#14141) --- .../api/service/impl/ProcessInstanceServiceImpl.java | 1 + .../task/dependent/DependentAsyncTaskExecuteFunction.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java index 5c804241b3..26606caa3b 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java @@ -496,6 +496,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl implements Proce if (TASK_TYPE_DEPENDENT.equalsIgnoreCase(taskInstance.getTaskType())) { log.info("DEPENDENT type task instance need to set dependent result, taskCode:{}, taskInstanceId:{}", taskInstance.getTaskCode(), taskInstance.getId()); + // TODO The result of dependent item should not be obtained from the log, waiting for optimization. Result logResult = loggerService.queryLog(loginUser, taskInstance.getId(), Constants.LOG_QUERY_SKIP_LINE_NUMBER, Constants.LOG_QUERY_LIMIT); if (logResult.getCode() == Status.SUCCESS.ordinal()) { diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/dependent/DependentAsyncTaskExecuteFunction.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/dependent/DependentAsyncTaskExecuteFunction.java index 9cfa8f6b06..86517f5a1d 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/dependent/DependentAsyncTaskExecuteFunction.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/dependent/DependentAsyncTaskExecuteFunction.java @@ -17,6 +17,8 @@ package org.apache.dolphinscheduler.server.master.runner.task.dependent; +import static org.apache.dolphinscheduler.common.constants.Constants.DEPENDENT_SPLIT; + import org.apache.dolphinscheduler.common.constants.Constants; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; @@ -196,7 +198,10 @@ public class DependentAsyncTaskExecuteFunction implements AsyncTaskExecuteFuncti dependentExecute.getDependResultMap().forEach((dependentKey, dependResult) -> { if (!dependResultMap.containsKey(dependentKey)) { dependResultMap.put(dependentKey, dependResult); - log.info("Dependent item check finished: dependentKey: {}, result: {}, dependentDate: {}", + // The log is applied in: api-server obtains the result of the item dependent in the dependent task + // node.{@link ProcessInstanceServiceImpl#parseLogForDependentResult} + log.info("Dependent item check finished, {} dependentKey: {}, result: {}, dependentDate: {}", + DEPENDENT_SPLIT, dependentKey, dependResult, dependentDate); }