scheduler/src/main/java/com/cognitree/kronos/scheduler/TaskProvider.java
/**
     * Check if all the dependant tasks for the given task are available and not in failed state.
     *
     * @param task
     * @return false when dependant tasks are in failed state or not found, true otherwise
     */
Check if all the dependant tasks for the given task are available and not in failed state.
@param task
@return false when dependant tasks are in failed state or not found, true otherwise
Check if all the dependant tasks for the given task are available and not in failed state . @param task @return false when dependant tasks are in failed state or not found true otherwise
synchronized boolean resolve(Task task) {
        final List<String> dependsOn = task.getDependsOn();
        if (dependsOn != null) {
            List<Task> dependentTasks = new ArrayList<>();
            for (String dependentTaskName : dependsOn) {
                TaskId dependentTaskId = TaskId.build(task.getNamespace(), dependentTaskName, task.getJob(),
                        task.getWorkflow());
                Task dependentTask = getTask(dependentTaskId);
                if (dependentTask == null) {
                    logger.error("No dependent task with id {} not found", dependentTaskId);
                    return false;
                }
                if (dependentTask.getStatus() == FAILED) {
                    logger.error("Dependent task with id {} is in failed state", dependentTaskId);
                    return false;
                }
                dependentTasks.add(dependentTask);
            }
            dependentTasks.forEach(dependentTask -> addDependency(dependentTask, task));
        }
        return true;
    }
synchronized boolean resolve ( Task task ) { final List < String > dependsOn = task . getDependsOn ( ) ; if ( dependsOn != null ) { List < Task > dependentTasks = new ArrayList < > ( ) ; for ( String dependentTaskName : dependsOn ) { TaskId dependentTaskId = TaskId . build ( task . getNamespace ( ) , dependentTaskName , task . getJob ( ) , task . getWorkflow ( ) ) ; Task dependentTask = getTask ( dependentTaskId ) ; if ( dependentTask == null ) { logger . error ( "No dependent task with id {} not found" , dependentTaskId ) ; return false ; } if ( dependentTask . getStatus ( ) == FAILED ) { logger . error ( "Dependent task with id {} is in failed state" , dependentTaskId ) ; return false ; } dependentTasks . add ( dependentTask ) ; } dependentTasks . forEach ( dependentTask -> addDependency ( dependentTask , task ) ) ; } return true ; }
Check if all the dependant tasks for the given task are available and not in failed state.
Check if all the dependant tasks for the given task are available and not in failed state .