agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobManager.java
/**
     * Rolls a {@link Job} back to the previously active state based on its current {@link JobStatusType}.
     *
     * @param job the job to roll back to previous {@link JobStatusType}
     * @param requestedBy the principal requesting the job be reset
     * @throws JobException if unable to update the job
     */
Rolls a  Job back to the previously active state based on its current  JobStatusType.
@param job the job to roll back to previous  JobStatusType
@param requestedBy the principal requesting the job be reset
@throws JobException if unable to update the job
Rolls a Job back to the previously active state based on its current JobStatusType . @param job the job to roll back to previous JobStatusType @param requestedBy the principal requesting the job be reset @throws JobException if unable to update the job
public static Job resetToPreviousState(Job job, String requestedBy)
            throws JobException, JobDependencyException {
        if (job == null) {
            throw new JobException("Job cannot be null");
        }
        ZombieJobWatch zombieJob = new ZombieJobWatch();
        Job updatedJob = null;
        try {
            updatedJob = zombieJob.rollbackJob(job, requestedBy);
            JobEvent event = new JobEvent("RESET", "Job was manually reset to " +
                    updatedJob.getStatus().name() + " by " + requestedBy, requestedBy);
            event.setJob(updatedJob);
            updatedJob.addEvent(event);
            JobDao.persist(updatedJob);
            releaseLocalJobLock(updatedJob);
            return updatedJob;
        } catch (JobException e) {
            throw new JobException("Failed to reset job to previous state.", e);
        } catch (JobDependencyException e) {
            throw new JobException("Unable to reset inactive jobs to previous state.");
        }
    }
public static Job resetToPreviousState ( Job job , String requestedBy ) throws JobException , JobDependencyException { if ( job == null ) { throw new JobException ( "Job cannot be null" ) ; } ZombieJobWatch zombieJob = new ZombieJobWatch ( ) ; Job updatedJob = null ; try { updatedJob = zombieJob . rollbackJob ( job , requestedBy ) ; JobEvent event = new JobEvent ( "RESET" , "Job was manually reset to " + updatedJob . getStatus ( ) . name ( ) + " by " + requestedBy , requestedBy ) ; event . setJob ( updatedJob ) ; updatedJob . addEvent ( event ) ; JobDao . persist ( updatedJob ) ; releaseLocalJobLock ( updatedJob ) ; return updatedJob ; } catch ( JobException e ) { throw new JobException ( "Failed to reset job to previous state." , e ) ; } catch ( JobDependencyException e ) { throw new JobException ( "Unable to reset inactive jobs to previous state." ) ; } }
Rolls a {@link Job} back to the previously active state based on its current {@link JobStatusType}.
Rolls a { @link Job } back to the previously active state based on its current { @link JobStatusType } .