I have three level hierarchy of jobs.
<job id="job1">
<step id="step1" >
<job ref="step1.job1.1" job-parameters-extractor="job1Parameters"/>
</step>
</job>
<job id="job1.1">
<step id="step1.1" >
<job ref="step1.1.job1.1.1"/>
</step>
</job>
<job id="job1.1.1">
<step id="step1.1.1" >
<tasklet ref="ste1.1.1Tasklet" />
</step>
</job>
I want to pass param1=value1 parameters from top level job (job1) to job1.1 and which should again pass it to job1.1.1 ?
How it can be done in spring batch ? I was trying to use
<util:map id="job1Parameters"
map-class="org.springframework.beans.factory.config.MapFactoryBean">
<beans:entry key="param1" value="value1" />
</util:map>
<beans:bean id="otherComputeJobParametersExtractor"
class="org.springframework.batch.core.step.job.DefaultJobParametersExtractor"
p:keys-ref="job1Parameters" />
But its not working.
I know I can pass it as a parameter to job1 and it will be automatically passed to child jobs but there are many parameters and many of those are only for sepecific child jobs so I dont want to pass all parameters to job1.
Can we add any step listener which will add param1=value1 in stepExecutionContext just before triggering child job so the parameters are available to child job via stepExecutionContext ?