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

  • executioncontextpromotionlistener example

    Hi,

    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 23rd, 2011, 12:49 AM.

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

    any example ?

    Comment


    • #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.

      Comment

      Working...
      X