Mar 8th, 2010, 05:42 PM
Adding custom parameters for app status
I need to add some custom parameters for each job run , like output file names, input files, count etc.
Some of which are not already present in any of the contexts like stepcontext , jobcontext, etc
What is best way to add these params , so that those are presisted in spring batch tables and can be retrieved using jobexplorer
Mar 10th, 2010, 11:26 AM
I must be missing something. Why don't you use JobParameters?
Mar 10th, 2010, 03:18 PM
These are runtime parameters which are generated dynamically and added at various steps.
I can add most of the params in beforestep in stepcontext and jobcontext but is there any way of adding params at runtime so that those are presisted
Mar 11th, 2010, 02:07 AM
The ExecutionContext is persisted. You can use ItemStream to manage the step-level context, and there are established patterns for transferring data to/from the job-level ExecutionContext. This is all covered in the user guide (http://static.springsource.org/sprin...tml#itemStream, http://static.springsource.org/sprin...aToFutureSteps). Since you mention stepContext and jobContext, I assume that is what you are already doing?