title: How to terminate Step within a Spring Batch Split Flow with a Decider
body: <p>I've happened up the following design defect in Spring Batch.</p>
  
  <ol>
  <li>A Step must have a Next attribute unless it is the last Step or last Step of a Split Flow.</li>
  <li>A Decider block must handle all cases returned by the Decider.</li>
  </ol>
  
  <p>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.</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;!-- Process parallel steps --&gt;
  &lt;split id="split01"&gt;
      &lt;flow&gt;
          &lt;step id="step1" next="step02"&gt;
              &lt;!-- Do something --&gt;
          &lt;/step&gt;
          &lt;step id="step02"&gt;
              &lt;!-- Do something else --&gt;
          &lt;/step&gt;
      &lt;/flow&gt;
      &lt;flow&gt;
          &lt;step id="step03"&gt;
              &lt;!-- Do something --&gt;
          &lt;/step&gt;
  
          &lt;!-- Only run under specific conditions --&gt;
          &lt;decision id="decideToRunStep04" decider="isStepNeededDecider" &gt;
              &lt;next on="RUN" to="step04"/&gt;
              &lt;!-- Other state is "SKIP" --&gt;
          &lt;/decision&gt;
          &lt;step id="step04"&gt;
              &lt;!-- Conditionally do something--&gt;
          &lt;/step&gt;
      &lt;/flow&gt;
  &lt;/split&gt;
  
  &lt;step id="step05" &gt;
      &lt;!-- Some more stuff --&gt;
  &lt;/step&gt;
  </code></pre>
  
  <p>This seems like something the Spring guys would have thought of, so curious what the right, non-hack way to achieve this is. Thanks.</p>