-
Jan 23rd, 2012, 02:39 AM
#1
Conditional Flow execution
Hello,
I m trying to configure a conditional execution to my spring batch. The requirement says if Step 1 is true goto Step 4 else Step 3.
<batch:job id="job">
<batch:step id="step1" next="step2">
<batch:tasklet>
<batch:chunk reader="someReader" processor="someProcessor" writer="someWriter"
</batch:tasklet>
<batch:next on="true" to="step3" />
<batch:next on="false" to="step4" />
</batch:step>
<batch:step id="step2">
<batch:tasklet>
<batch:chunk reader="someReader" writer="someWriter"
</batch:tasklet>
</batch:step>
<batch:step id="step3">
<batch:tasklet ref="someImpl" />
</batch:step>
<batch:step id="step4">
<batch:tasklet ref="someImpl" />
</batch:step>
</batch:job>
I want to configure above steps for my batch execution. But I m not sure how would I set the routing i.e. "true " or "false" in which class? And if I follow the above configuration would it allow me to route conditionally? If you could please help me with a sample code that would really helpful. I did try to search on the site but I didnt find solution for the above question. I found only ways to configure my job-context.xml.
Thanks,
Pooh.
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