Announcement Announcement Module
Collapse
No announcement yet.
BatchId Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BatchId

    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

  • #2
    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();
    }

    Comment


    • #3
      Its working.

      Thanks Garrette

      Comment

      Working...
      X