title: How to Check null condition in Data weaver : Mule
body: <p>Here is my xml, in that first I need to check 'RecordsEntries' should not be 'null', then RecordEntry shouldn't be <code>null</code> followed by mapping code</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Records&gt;
    &lt;storenumber /&gt;
    &lt;calculated&gt;false&lt;/calculated&gt;
    &lt;subTotal&gt;12&lt;/subTotal&gt;
   &lt;RecordsEntries&gt;
     &lt;RecordEntry&gt;
       &lt;deliverycharge&gt;30.0&lt;/deliverycharge&gt;
       &lt;entryNumber&gt;8&lt;/entryNumber&gt;
       &lt;Value&gt;true&lt;/Value&gt;
    &lt;/RecordEntry&gt;
    &lt;RecordEntry&gt;
      &lt;deliverycharge&gt;20.0&lt;/deliverycharge&gt;
      &lt;entryNumber&gt;7&lt;/entryNumber&gt;
      &lt;Value&gt;false&lt;/Value&gt;
    &lt;/RecordEntry&gt;
  &lt;/RecordsEntries&gt;
   &lt;RecordsEntries&gt;
      &lt;RecordEntry&gt;
        &lt;deliverycharge&gt;30.0&lt;/deliverycharge&gt;
        &lt;entryNumber&gt;8&lt;/entryNumber&gt;
        &lt;Value&gt;false&lt;/Value&gt;
      &lt;/RecordEntry&gt;
   &lt;/RecordsEntries&gt;
  &lt;/Records&gt;
  </code></pre>
  
  <p>Tried multiple scenario's also used <code>when</code> condition checking but somewhere missing parenthesis or correct format</p>
  
  <pre><code>    orders: {
      order: {
    StoreID: payload.Records.storenumber,
    Total: payload.Records.calculated,
   (( payload.Records.RecordsEntries.*RecordEntry ) map {
      IndividualEntry: {
      Number:$.entryNumber,
      DeliverCharge:$.deliverycharge
      }
    } when ( payload.Records.RecordsEntries != null and payload.Records.RecordsEntries.*RecordEntry !=null))}
  }
  </code></pre>
  
  <p>getting error like missing <code>)</code>. Tried other way around by checking the null condition directly inside the first loop got error like "Cannot coerce array to an boolean". Please suggest. Thanks.</p>