You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/08/05 03:11:33 UTC

[GitHub] [dolphinscheduler] lordk911 commented on pull request #10952: fix dependent task when the dependent on process have forbidden tasks

lordk911 commented on PR #10952:
URL: https://github.com/apache/dolphinscheduler/pull/10952#issuecomment-1205995409

   > > Depending on a single task will also have this bug, please fix it
   > > Can refer to
   > > `    private DependResult getDependTaskResult(ProcessInstance processInstance, long taskCode, DateInterval dateInterval) {         TaskInstance taskInstance = processService.findLastTaskInstanceInterval(taskCode, dateInterval);         if (taskInstance == null) {             TaskDefinition taskDefinition = processService.findTaskDefinitionByCode(taskCode);             if (taskDefinition == null) {                 logger.error("Cannot find the task definition, something error, taskCode: {}", taskCode);                 return DependResult.FAILED;             }             if (taskDefinition.getFlag() == Flag.NO) {                 logger.warn("Cannot find the task instance, but the task is forbidden, so dependent success, taskCode: {}, taskName: {}", taskCode, taskDefinition.getName());                 return DependResult.SUCCESS;             }             if (!processInstance.getState().typeIsFinished()) {                 logger.info("Wait for the dependent workflow to complete,
  taskCode:{}, processInstanceId:{}, processInstance state:{}",                         taskCode, processInstance.getId(), processInstance.getState());                 return DependResult.WAITING;             }             logger.warn("Cannot find the task in the process instance when the ProcessInstance is finish, taskCode: {}, taskName: {}", taskCode, taskDefinition.getName());             return DependResult.FAILED;         } else {             logger.info("The running task, taskId:{}, taskCode:{}, taskName:{}", taskInstance.getId(), taskInstance.getTaskCode(), taskInstance.getName());             return getDependResultByState(taskInstance.getState());         }     }`
   
   thanks, I've just reuse your code @JinyLeeChina 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org