Announcement Announcement Module
Collapse
No announcement yet.
Saving to the ExecutionContext in the JobExecutionListener.afterJob method Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Saving to the ExecutionContext in the JobExecutionListener.afterJob method

    I'm having an issue where I need to persist some object to the ExecutionContext after a job finishes.

    I implemented a JobExecutionListener with beforeJob and afterJob methods however I only am retaining the beforeJob changes, and the afterJob changes are lost:

    @Override
    public void afterJob(JobExecution jobExecution) {
    jobExecution.getExecutionContext().put("test3", "test4"); //THIS DOESN'T WORK
    }

    @Override
    public void beforeJob(JobExecution jobExecution) {
    jobExecution.getExecutionContext().put("test", "test2"); //THIS WORKS
    }



    Can anyone help me get around this issue?

    Thanks
Working...
X