title: Mule batch commit Message payload is of type: RegularImmutableList
body: <p>I have Mule batch commit as:</p>
  
  <pre><code>&lt;batch:step name="Batch_Step1"&gt; 
      &lt;enricher source="#[message.payload]" target="#[recordVars.accountJson]" doc:name="Message Enricher"&gt;
          &lt;json:object-to-json-transformer doc:name="Object to JSON"/&gt;
      &lt;/enricher&gt;
      &lt;batch:set-record-variable variableName="client_id" value="#[message.payload.client_id]" doc:name="client_id"/&gt;
      &lt;batch:commit size="10" doc:name="Batch Commit"&gt;
          &lt;sfdc:query config-ref="SFDC_Config" query="dsql:SELECT Id FROM Account WHERE Client_ID__c = '#[message.payload.client_id]'" doc:name="Account-Query"/&gt;
          &lt;set-payload value="#[message.payload.hasNext() ? message.payload.next(): 'none']" doc:name="sfdc-data"/&gt;   
      &lt;/batch:commit&gt;
  &lt;/batch:step&gt;
  </code></pre>
  
  <p>If i don't put batch-commit, application works fine, but If i use batch-commit, I am getting below error message:</p>
  
  <pre><code>INFO  2015-07-29 14:19:44,636 [batch-job-clientaccount-Batch-work-manager.01] com.mulesoft.module.batch.DefaultBatchStep: Found exception processing record on step 'Batch_Step1' for job instance '86987df0-3637-11e5-81ea-0026b9eef95d' of job 'clientaccount-Batch'.
  This is the first record to show this exception on this step for this job instance. Subsequent records with the same failureswill not be logged for performance and log readability reasons:
  
  ********************************************************************************
  Message               : Failed to invoke query. Message payload is of type: RegularImmutableList
  Code                  : MULE_ERROR--2
  --------------------------------------------------------------------------------
  Exception stack is:
  1. com.google.common.collect.RegularImmutableList cannot be cast to java.util.Map (java.lang.ClassCastException)
    org.mule.mvel2.optimizers.impl.refl.nodes.MapAccessor:42 (null)
  2. cannot invoke getter: getPayload [declr.class: org.mule.el.context.MessageContext; act.class: org.mule.el.context.MessageContext] (see trace) (java.lang.RuntimeException)
    org.mule.mvel2.optimizers.impl.refl.nodes.GetterAccessor:74 (null)
  3. Execution of the expression "message.payload.client_id" failed. (org.mule.api.expression.ExpressionRuntimeException)
    org.mule.el.mvel.MVELExpressionLanguage:202 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/ExpressionRuntimeException.html)
  4. Failed to invoke query. Message payload is of type: RegularImmutableList (org.mule.api.MessagingException)
    org.mule.devkit.processor.DevkitBasedMessageProcessor:133 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
  --------------------------------------------------------------------------------
  Root Exception stack trace:
  java.lang.ClassCastException: com.google.common.collect.RegularImmutableList cannot be cast to java.util.Map
      at org.mule.mvel2.optimizers.impl.refl.nodes.MapAccessor.getValue(MapAccessor.java:42)
      at org.mule.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:40)
      at org.mule.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)
      + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
  ********************************************************************************
  </code></pre>
  
  <p>Question 2) </p>
  
  <p>Not able to use recordVars inside batch commit.Getting error as:</p>
  
  <pre><code>Exception stack is:
  1. No record could be found in payload or in flow variable BATCH_RECORD (java.lang.IllegalStateException)
    com.mulesoft.module.batch.record.BatchUtils:56 (null)
  2. [Error: No record could be found in payload or in flow variable BATCH_RECORD]
  [Near : {... recordVars.client_id ....}]
               ^
  [Line: 1, Column: 1] (org.mule.mvel2.CompileException)
  </code></pre>