I've happened up the following design defect in Spring Batch.
- A Step must have a Next attribute unless it is the last Step or last Step of a Split Flow.
- A Decider block must handle all cases returned by the Decider.
Because of this, in a Split Flow, where the final Step would not have a Next attribute, if there is a Decider guarding it, then it must have a Next attribute. So it shouldn't have that attribute, but it also needs it. Catch 22.
Example:
<!-- Process parallel steps -->
<split id="split01">
<flow>
<step id="step1" next="step02">
<!-- Do something -->
</step>
<step id="step02">
<!-- Do something else -->
</step>
</flow>
<flow>
<step id="step03">
<!-- Do something -->
</step>
<!-- Only run under specific conditions -->
<decision id="decideToRunStep04" decider="isStepNeededDecider" >
<next on="RUN" to="step04"/>
<!-- Other state is "SKIP" -->
</decision>
<step id="step04">
<!-- Conditionally do something-->
</step>
</flow>
</split>
<step id="step05" >
<!-- Some more stuff -->
</step>
This seems like something the Spring guys would have thought of, so curious what the right, non-hack way to achieve this is. Thanks.