Java Reference
In-Depth Information
<beans:bean id="outputFile" class="org.springframework.core.io.FileSystemResource"
scope="step">
<beans:constructor-arg value="#{jobParameters[outputFile]}"/>
</beans:bean>
<beans:bean id="pickListFormatter"
class="com.apress.springbatch.chapter11.writer.PickListFormatter"/>
<beans:bean id="pickListOutputWriter"
class="org.springframework.batch.item.file.FlatFileItemWriter">
<beans:property name="lineAggregator" ref="pickListFormatter"/>
</beans:bean>
<beans:bean id="pickListWriter"
class="org.springframework.batch.item.file.MultiResourceItemWriter">
<beans:property name="resource" ref="outputFile"/>
<beans:property name="delegate" ref="pickListOutputWriter"/>
<beans:property name="itemCountLimitPerResource" value="1"/>
</beans:bean>
<step id="processOrderStep">
<tasklet>
<chunk reader="validatedOrderItemReader" writer="pickListWriter"
commit-interval="1"/>
</tasklet>
</step>
<job id="parallelJob">
<step id="step1" parent="preloadDataStep" next="step2"/>
<step id="step2" parent="batchOrderProcessingStep" next="parallelProcessing"/>
<split id="parallelProcessing" task-executor="taskExecutor" next="step5">
<flow>
<step id="step3" parent="creditVerificationStep"/>
</flow>
<flow>
<step id="step4" parent="inventoryVerificationStep"/>
</flow>
</split>
<step id="step5" parent="processOrderStep"/>
</job>
Obviously, when you run this job, the output will vary given that the orders are randomly generated.
However, for any given run, a couple of picklists are generated. Listing 11-19 shows the output of a
picklist generated from the batch job.
Search WWH ::




Custom Search