title: Getting FlowExecutionException when using JobExecutionDecider in Spring Batch
body: <p>I am new to Spring Batch . I implemented a <code>JobExecutionDecider</code> . Below is the code</p>
  <pre><code>@Component(&quot;customStepDecider&quot;)
  @NoArgsConstructor
  public class CustomStepDecider implements JobExecutionDecider {
  
  Environment environment;
  private String executeStep;
  public static  final String EXECUTE=&quot;EXECUTE&quot;;
  public static  final String SKIP=&quot;SKIP&quot;;
  @Override
  public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution) {
      if(Boolean.parseBoolean(environment.getProperty(executeStep)))
          return new FlowExecutionStatus(EXECUTE);
      else
          return new FlowExecutionStatus(SKIP);
  
  }
  public CustomStepDecider(String stepToExecute,Environment environment){
            this.executeStep=stepToExecute;
             this.environment=environment;}}
  </code></pre>
  <p>Below is the <code>Flow</code> that calls the <code>JobExecutionDecider</code>.The <code>Environiment</code> is already autowired and same is passed to <code>CustomStepDecider</code></p>
  <pre><code> @Bean(name = &quot;customStepExecutionFlow&quot;)
  
      public Flow customStepExecutionFlow(){
          return new FlowBuilder&lt;SimpleFlow&gt;(&quot;customStepExecutionFlow&quot;)
                  .start(new CustomStepDecider(&quot;file.executeStep1&quot;,env))
                  .on(&quot;EXECUTE&quot;).to(step1)
                  .from(new CustomStepDecider(&quot;file.executeStep2&quot;,env))
                  .on(&quot;SKIP&quot;)
                  .to(new CustomStepDecider(&quot;file.if214FileGenerationStep&quot;,env))
                  .on(&quot;EXECUTE&quot;)
                  .to(step2)
                  .on(&quot;SKIP&quot;).end()
                  .build();
  
  
  
      }
  </code></pre>
  <p>The functionality I need is the <code>JobExecutionDecider</code> first looks at properties file if it is false, it should skip step execution .If it is true it should execute the step.Below are my properties file</p>
  <pre><code>file.executeStep1=false
  file.executeStep2=true
  </code></pre>
  <p>But whenever I am running I am getting the below error</p>
  <pre><code> org.springframework.batch.core.job.flow.FlowExecutionException: Next state not found in flow=customStepExecutionFlow for state=customStepExecutionFlow.decision0 with exit status=SKIP
  </code></pre>
  <p>Where am I going wrong?</p>