-
Nov 20th, 2008, 06:12 AM
#1
How can the JobParameters be available for steps?
Hi!
I add some parameters in a JobParameters object when I launch my Jobs with org.springframework.batch.core.repository.support. JobRepositoryFactoryBean and org.springframework.batch.core.launch.support.Simp leJobLauncher.
The job is a org.springframework.batch.core.job.SimpleJob with a single step.
The step is a org.springframework.batch.core.step.item.SkipLimit StepFactoryBean
which has a org.springframework.batch.item.database.DrivingQue ryItemReader which contains a custom KeyCollector.
This keycollector needs to access the jobParameters in order to obtain some input data to be able to fetch they keys - hos can this be done as the execution context is missing these parameters (the jobparameters)?
-
Nov 20th, 2008, 09:11 AM
#2
In 1.1.x, make your collector a StepExecutionListener, register it with the step, and call stepExecution.getJobParameters().
In 2.0, simply wire in the property with #{jobParameter[parameter.name]}
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