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

  • executioncontextpromotionlistener example


    I need to read a file and file contains a single value, a number,
    which i need to propagate to next step , which is sqlquery based.

    i need a example of how to pass values between steps.

    Any example on StepExecutionListener will also help.

    Basically, wanted to pass the value to next step , sql query.
    Last edited by fusionobject; Jun 22nd, 2011, 11:49 PM.

  • #2
    pass value in step 1 programmatic-ally and collect that value in step 2 using {STEPEXECUTIONCONTEXT} bind method ?

    any example ?


    • #3
      all you need is a bean of class org.springframework.batch.core.listener.ExecutionC ontextPromotionListener. You give it the map key name(s) it should look for. Then you just put what you want passed from step to step into the current step's execution context with that key name. After the step is complete the ExecutionContextPromotionListener looks for things with the configured key names from the step context and puts them in the job context. In your next step you pull that from the job context.