-
Jun 22nd, 2011, 10:16 PM
#1
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 22nd, 2011 at 11:49 PM.
-
Jun 23rd, 2011, 11:13 AM
#2
pass value in step 1 programmatic-ally and collect that value in step 2 using {STEPEXECUTIONCONTEXT} bind method ?
any example ?
-
Aug 2nd, 2011, 12:35 PM
#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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules