title: How can I enable or disable a Step dynamically reading the enableStatus from the Database?
body: <pre><code>@Bean
      public Step step1(){
          return stepBuilderFactory.get(&quot;checkInfo&quot;).&lt;A, B&gt;chunk(10)
                  .reader(reader())
                  .processor(processor())
                  .writer(writer())
                  .build();
      }
  </code></pre>
  <p>I have created this step called &quot;checkInfo&quot;, and i have other steps with other name. In my database I have a table &quot;STEPS&quot; with the name of the step and if it is enabled or disabled.
  So i have to chain only the steps enabled to my JOB.</p>
  <pre><code>@PostConstruct
      public void getActiveSteps(){
          stepsList = stepManagementRepository.findAllByActive(true);
          for (StepManagement s : stepsList){
              System.out.println(s.getDescription());
          }
  </code></pre>
  <p>I get all of the active ones in this function. The problem is, how can I get the step i want by the name saved on my DB? (So then i can use the .next() in the job, only if the step is active)</p>
  <pre><code>@Bean
      public Job runJob(){
          SimpleJobBuilder jobBuilder = jobBuilderFactory.get(&quot;mainCalculationJob&quot;)
                  .incrementer(new RunIdIncrementer())
                  .start(step1());
          return jobBuilder.build();
      }
      
  </code></pre>