private boolean isJobExecutionRestartable(JobExecution jobExecution) {
		JobInstance jobInstance = jobExecution.getJobInstance();
		BatchStatus status = jobExecution.getStatus();
		try {
			List<JobExecution> jobExecutionsForJobInstance = (List<JobExecution>) jobService.getJobExecutionsForJobInstance(
					jobInstance.getJobName(), jobInstance.getId());
			for (JobExecution jobExecutionForJobInstance : jobExecutionsForJobInstance) {
				if (jobExecutionForJobInstance.getStatus() == BatchStatus.COMPLETED) {
					return false;
				}
			}
		}
		catch (NoSuchJobException e) {
			throw new NoSuchBatchJobException(jobInstance.getJobName());
		}
		return status.isGreaterThan(BatchStatus.STOPPING) && status.isLessThan(BatchStatus.ABANDONED);
	}
Check if the {@link JobInstance} corresponds to the given {@link JobExecution}
has any of the JobExecutions in {@link BatchStatus.COMPLETED} status
@param jobExecution the jobExecution to check for
@return boolean flag to set if this job execution can be restarted
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/rest/BatchJobExecutionsController.java