title: Mule:Iterating over ArrayList
body: <p>I am trying to save an ArrayList into a flowVar &amp; then iterate over the flowVar in a foreach statement, the code is as follows:</p>
  
  <p>payload[2] is an array which part of arrayList.</p>
  
  <p></p>
  
  <pre><code>      &lt;foreach collection="#[flowVars['ID']]" doc:name="For Each"&gt; 
  
          ....
  
  
       &lt;/foreach&gt; 
  </code></pre>
  
  <p>However I get the following error when I try to run this code:</p>
  
  <p>org.mule.exception.DefaultMessagingExceptionStrategy: </p>
  
  <hr>
  
  <p>Message               : not a statement (org.mule.mvel2.ScriptRuntimeException). Message payload is of type: LinkedList</p>
  
  <p>Any ideas?</p>