JobManagerService jobManager = Globals.getDefaultHabitat().getService(JobManagerService.class);
jobManager.getRetryableJobsInfo().put(id, CheckpointHelper.CheckpointFilename.createBasic(this));
jobManager.purgeJob(id);
setState(State.FAILED_RETRYABLE);
} else {
JobPersistence jobPersistenceService;
if (scope != null) {
jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistence.class,scope+"job-persistence");
} else {
jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
}
State finalState = State.COMPLETED;
if (getState().equals(State.REVERTING)) {
finalState = State.REVERTED;
}
String user = null;
if(subjectUsernames.size() > 0){
user = subjectUsernames.get(0);
}
jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,report.getActionExitCode().name(),user,report.getMessage(),getJobsFile(),finalState.name(),completionDate));
if (getState().equals(State.RUNNING_RETRYABLE) || getState().equals(State.REVERTING)) {
JobManagerService jobManager = Globals.getDefaultHabitat().getService(JobManagerService.class);
File jobFile = getJobsFile();
if (jobFile == null) {
jobFile = jobManager.getJobsFile();