title: Spring Batch javaConfig: Conditional Flow
body: <p>Is there any suggestions to the way to transfrom this xml config to javaconfig:</p>
  
  <pre><code>&lt;job id="job"&gt;
      &lt;step id="step1" &gt;
          &lt;next on="FAILED" to="step2"/&gt;
          &lt;next on="*" to="step3"/&gt; 
      &lt;/step&gt;
      &lt;step id="step2"/&gt;
      &lt;step id="step3"next="step4"/&gt;
      &lt;step id="step4"/&gt;
  &lt;/job&gt;  
  </code></pre>
  
  <p>I was able to create a job having one step leading to another step on success and to a different one on failure:</p>
  
  <pre><code>SimpleJobBuilder builder = new JobBuilder("job").repository(jobRepository)
  .start(step1()).next(step2())
  .on("FAILED").to(step3()).build();  
  </code></pre>