feiyalun commented on a change in pull request #2327: #2282 fix workflow
dependent bug
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/2327#discussion_r399643451
##########
File path:
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/dependent/DependentExecute.java
##########
@@ -104,25 +105,29 @@ private DependResult
calculateResultForTasks(DependentItem dependentItem,
dependentItem.getDefinitionId(),
dateInterval.getStartTime(), dateInterval.getEndTime() );
return DependResult.FAILED;
}
+
if(dependentItem.getDepTasks().equals(Constants.DEPENDENT_ALL)){
- result = getDependResultByState(processInstance.getState());
- }else{
- TaskInstance taskInstance = null;
- List<TaskInstance> taskInstanceList =
processService.findValidTaskListByProcessId(processInstance.getId());
+ List<TaskNode> taskNodes =
+
processService.getTaskNodeListByDefinitionId(dependentItem.getDefinitionId());
- for(TaskInstance task : taskInstanceList){
- if(task.getName().equals(dependentItem.getDepTasks())){
- taskInstance = task;
- break;
- }
- }
- if(taskInstance == null){
- // cannot find task in the process instance
- // maybe because process instance is running or failed.
- result =
getDependResultByState(processInstance.getState());
+ if(taskNodes.size() == 0){
Review comment:
taskNodes. you think must not is empity ?? why write it is if(
CollectionUtils.isNotEmpty(taskNodes)&&taskNodes.size() == 0){
/////
}
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services