title: Passing info between steps in Spring?
body: <p>I'm trying to make a Spring Batch and I have no experience with it.</p>
  
  <p>Is it possible to pass information from each batch step or must they be completely independent?</p>
  
  <p>For example if I have</p>
  
  <pre><code>   &lt;batch:step id="getSQLs" next="runSQLs"&gt;
          &lt;batch:tasklet transaction-manager="TransactionManager"
              ref="runGetSQLs" /&gt;
      &lt;/batch:step&gt;
  
      &lt;batch:step id="runSQLs"&gt;
          &lt;batch:tasklet transaction-manager="TransactionManager"
              ref="runRunSQLs" /&gt;
      &lt;/batch:step&gt;
  </code></pre>
  
  <p>And getSQLs triggers a bean which executes a class which generates a List of type String. Is it possible to reference that list for the bean triggered by runSQLs? ("triggered" may not be the right term but I think you know what I mean)</p>
  
  <p>UPDATE:
  So getSQLs step triggers this bean:</p>
  
  <pre><code>&lt;bean id="runGetSQLs" class="myTask"
      scope="step"&gt;
      &lt;property name="filePath" value="C:\Users\username\Desktop\sample.txt" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>which triggers myTask class which executes this method:</p>
  
  <pre><code>  @Override
  public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
  
      ExecutionContext stepContext = this.stepExecution.getExecutionContext();
      stepContext.put("theListKey", sourceQueries);
  
      return RepeatStatus.FINISHED;
  }
  </code></pre>
  
  <p>Do I need to somehow pass stepExecution to the execute method?</p>