dill21yu commented on issue #16706:
URL: 
https://github.com/apache/dolphinscheduler/issues/16706#issuecomment-2909207916

       Add a new time-period-based result calculation method. Returns success 
if any workflow instance succeeds within the period (similar to 
calculateResultForTasks).
   private DependResult calculateResultForTasks(DependentItem dependentItem,
                                                    List<DateInterval> 
dateIntervals,
                                                    int testFlag) {
   
           DependResult result = DependResult.FAILED;
           for (DateInterval dateInterval : dateIntervals) {
               ProcessInstance processInstance = 
findLastProcessInterval(dependentItem.getDefinitionCode(),
                       dateInterval, testFlag);
               if (processInstance == null) {
                   return DependResult.WAITING;
               }
               // need to check workflow for updates, so get all task and check 
the task state
               if (dependentItem.getDepTaskCode() == 
Constants.DEPENDENT_WORKFLOW_CODE) {
                   result = dependResultByProcessInstance(processInstance);
               } else if (dependentItem.getDepTaskCode() == 
Constants.DEPENDENT_ALL_TASK_CODE) {
                   result = 
dependResultByAllTaskOfProcessInstance(processInstance, testFlag);
               } else {
                   result = dependResultBySingleTaskInstance(processInstance, 
dependentItem.getDepTaskCode(), testFlag);
               }
               if (result != DependResult.SUCCESS) {
                   break;
               }
           }
           return result;
       }


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to