src/Contracts/BaseJobset.php
public function getJobsetExecutionStatus()
    {
        $finished = count($this->jobs) > 0 ? true : false;
        $failed = false;
        $middle = false;

        foreach ($this->jobs as $job) {
            if ($job->isFailed()) {
                $finished = false;
                $middle = false;
                $failed = true;
                break;
            }
            $finished = $finished && $job->isFinished();
            if (!$job->isFinished() && !$job->isFailed()) {
                $middle = true;
            }
        }

        if ($failed) {
            return JobsConst::JOB_SET_STATUS_FAILED;
        } elseif ($finished) {
            return JobsConst::JOB_SET_STATUS_FINISHED;
        } elseif ($middle) {
            return JobsConst::JOB_SET_STATUS_ONGOING;
        } else {
            return JobsConst::JOB_SET_STATUS_DEFAULT;
        }
    }
public function getJobsetExecutionStatus()
    {
        $finished = count($this->jobs) > 0 ? true : false;
        $failed = false;
        $middle = false;

        foreach ($this->jobs as $job) {
            if ($job->isFailed()) {
                $finished = false;
                $middle = false;
                $failed = true;
                break;
            }
            $finished = $finished && $job->isFinished();
            if (!$job->isFinished() && !$job->isFailed()) {
                $middle = true;
            }
        }

        if ($failed) {
            return JobsConst::JOB_SET_STATUS_FAILED;
        } elseif ($finished) {
            return JobsConst::JOB_SET_STATUS_FINISHED;
        } elseif ($middle) {
            return JobsConst::JOB_SET_STATUS_ONGOING;
        } else {
            return JobsConst::JOB_SET_STATUS_DEFAULT;
        }
    }
public function getJobsetExecutionStatus ( ) { $ finished = count ( $ this -> jobs ) > 0 ? true : false ; $ failed = false ; $ middle = false ; foreach ( $ this -> jobs as $ job ) { if ( $ job -> isFailed ( ) ) { $ finished = false ; $ middle = false ; $ failed = true ; break ; } $ finished = $ finished && $ job -> isFinished ( ) ; if ( ! $ job -> isFinished ( ) && ! $ job -> isFailed ( ) ) { $ middle = true ; } } if ( $ failed ) { return JobsConst :: JOB_SET_STATUS_FAILED ; } elseif ( $ finished ) { return JobsConst :: JOB_SET_STATUS_FINISHED ; } elseif ( $ middle ) { return JobsConst :: JOB_SET_STATUS_ONGOING ; } else { return JobsConst :: JOB_SET_STATUS_DEFAULT ; } }
Get jobset execution status from sub jobs statuses.
At least one job failed, the jobset is failed.
All jobs finished, the jobset is finished.
At least one job has been executed, the jobset is ongoing.
All jobs have not been executed, the jobset is in default status.

@return int
Get jobset execution status from sub jobs statuses . At least one job failed the jobset is failed . All jobs finished the jobset is finished . At least one job has been executed the jobset is ongoing . All jobs have not been executed the jobset is in default status .