Mule - route depending on json payload
<p>I'm running Mule CE 3.8 and need to route my messages depending on a value in the JSON payload.
I get a list of JSON from a REST endpoint which runs through a JSON2ObjectList and a collection splitter.</p>

<pre><code>    &lt;http:request ... /&gt; 
    &lt;json:json-to-object-transformer returnClass="java.util.List" encoding="UTF-8" doc:name="JSON2ObjectList"/&gt;
    &lt;collection-splitter doc:name="Collection Splitter"/&gt;
    &lt;custom-transformer ../&gt;
</code></pre>

<p>Now before the CustomTransformer and all the mapping I need to have a choice router that separates the messages depending on the payloads <em>Product.Warehouse</em> value. I was thinking of a Java component that could set a flow variable to the value of the Warehouse field but maybe there is an easier way to solve this?
I looked into MEL and expression transformers but couldn't figure that one out.</p>

<p>Regards</p>