Browse Source

Fix dependent task nodes in workflow instances cannot display data (#14141)

Kerwin 1 year ago
parent
commit
503d54aff9

+ 1 - 0
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<ResponseTaskLog> logResult = loggerService.queryLog(loginUser,
                         taskInstance.getId(), Constants.LOG_QUERY_SKIP_LINE_NUMBER, Constants.LOG_QUERY_LIMIT);
                 if (logResult.getCode() == Status.SUCCESS.ordinal()) {

+ 6 - 1
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);
                 }