@Override
	public StepExecution getLastStepExecution(JobInstance jobInstance, String stepName) {
		List<JobExecution> jobExecutions = jobExecutionDao.findJobExecutions(jobInstance);
		List<StepExecution> stepExecutions = new ArrayList<StepExecution>(jobExecutions.size());

		for (JobExecution jobExecution : jobExecutions) {
			stepExecutionDao.addStepExecutions(jobExecution);
			for (StepExecution stepExecution : jobExecution.getStepExecutions()) {
				if (stepName.equals(stepExecution.getStepName())) {
					stepExecutions.add(stepExecution);
				}
			}
		}

		StepExecution latest = null;
		for (StepExecution stepExecution : stepExecutions) {
			if (latest == null) {
				latest = stepExecution;
			}
			if (latest.getStartTime().getTime() < stepExecution.getStartTime().getTime()) {
				latest = stepExecution;
			}
		}

		return latest;
	}
Returns the last {@link org.springframework.batch.core.StepExecution} for the
requested step <em>without</em> rehydrating the related
{@link org.springframework.batch.item.ExecutionContext}.

@param jobInstance The {@link org.springframework.batch.core.JobInstance} the step
					  should come from
@param stepName The name of the step to find
@return The related StepExecution
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/plugins/job/support/JobLaunchingJobRepository.java