The TaskletStep has a property "stepExecutionListeners"
Printable View
The TaskletStep has a property "stepExecutionListeners"
I don't think you even need to mess with injecting the StepExecution, just use late binding to put the values you want into the tasklet. Something like ${jobExecutionContext[my.summary.key]}
There's a section in the document explaining how to do this. In fact, before there's anymore back and forth, I think you should really read through the first three chapters. All of these topics are explained in detail there. If you don't feel like you understand after reading them, please post here. We're always working to make the documentation better, and if you can't understand it, I'd like to know why, so that I can address any issues. (May provide more examples, etc)
Hi there,
By any chance can anyone tell me why my job is getting executed again and again. I mean whenever i start my application, the job starts automatically (its single job) and the reader is executed again and again without going to the processor or the writer items. :confused:
Hi All,
Finally i am through with it. I have implemented tasklet and have got my job batch running successfully.:D
Following is my final configuration
<!-- Job Configuration - Start-->
<bean id="batchJob" parent="simpleJob">
<property name="name" value="Batch Job" />
<property name="steps">
<list>
<bean id="step1" parent="simpleStep">
<property name="itemReader" ref="initialJpaPagingItemReader" />
<property name="itemProcessor" ref="verifyItemProcessor" />
<property name="itemWriter" ref="dummyItemWriter" />
<property name="commitInterval" value="1000" />
<property name="listeners">
<list>
<ref bean="dummyItemWriter" />
<ref bean="xmlOutputFile" />
</list>
</property>
</bean>
<bean id="step2" parent="taskletStep">
<property name="tasklet" ref="ProcessingSummaryXmlWriter" />
<property name="stepExecutionListeners">
<list>
<ref bean="ProcessingSummaryXmlWriter" />
<ref bean="xmlOutputFile" />
</list>
</property>
<property name="streams">
<list>
<ref bean="staxEventItemWriter" />
</list>
</property>
</bean>
</list>
</property>
</bean>
<!-- Job Configuration - End-->
I would like to thank DHGarrette and lucasward for there valuable support. :)