@Override
public void afterExecution(ExecutionContext context) {
LOG.debug("Sending execution details..");
JobDescriptor jobDescriptor = context.getJobDescriptor();
JobDescriptor fresh = jobStore.findById(jobDescriptor.getId());
JobExecutionLog jobExecutionLog = new JobExecutionLog();
jobExecutionLog.setTimeTaken(context.getTimeTaken());
jobExecutionLog.setJob(fresh);
jobExecutionLog.setExecutedNormally(context.getExecutedNormally());
jobExecutionLog.setSummary(context.getSummary());
fresh.updateLastFire(context.getLastFire());
fresh.updateNextFire(context.getNextFire());
fresh.addOutput(jobExecutionLog);
if (jobDescriptor.isSaveOutput()) {
jobExecutionLog.setOutput(context.getOutput());
}
jmsTemplate.convertAndSend(fresh);
}