Hi,
When i run a batchJob, a jobExecutionId will be generated in BATCH_JOB_EXECUTION table in DB, how can i retrieve this id(which is created now) dynamically.
I want this id to be retreived either in processor or writer class.
Thanks,
Ramesh .K
Hi,
When i run a batchJob, a jobExecutionId will be generated in BATCH_JOB_EXECUTION table in DB, how can i retrieve this id(which is created now) dynamically.
I want this id to be retreived either in processor or writer class.
Thanks,
Ramesh .K
Since that value is in the JobExecution, you can obtain it from a BeforeStep or BeforeJob listener method on either the processor or writer class:
Code:@BeforeStep public void getJobExecutionId(StepExecution stepExecution) { this.jobExecutionId = stepExecution.getJobExecution().getId(); }
Its working.
Thanks Garrette