log.info("Modified jobParameters=" + jobParameters);
}
if (jobProperties != null && jobProperties.isRestart()) {
if (jobExplorer == null) {
throw new JobExecutionException("A JobExplorer must be provided for a restart or start next operation.");
}
JobExecution jobExecution = getLastFailedJobExecution(jobIdentifier);
if (log.isDebugEnabled()) {
log.info("Last failed JobExecution: " + jobExecution);
}
if (jobExecution == null && jobProperties.isFailRestart()) {
throw new JobExecutionNotFailedException("No failed or stopped execution found for job="
+ jobIdentifier);
} else {
log.info("No failed or stopped execution found for job=" + jobIdentifier
+ ", batch properties flag for failRestart=" + jobProperties.isFailRestart()
+ " so we don't fail restart.");
}
if (jobExecution != null) {
restart = true;
jobParameters = jobExecution.getJobParameters();
}
}
if (jobProperties != null && jobProperties.isNext() && !restart) {
if (jobExplorer == null) {
throw new JobExecutionException("A JobExplorer must be provided for a restart or start next operation.");
}
JobParameters nextParameters = getNextJobParameters(job, false);
Map<String, JobParameter> map = new HashMap<String, JobParameter>(nextParameters.getParameters());
map.putAll(jobParameters.getParameters());
jobParameters = new JobParameters(map);