Explaining $ in Mule MEL

I can't find any documentation about using $ in MEL other than a couple of lines here

You can refer to any Java class by its fully qualified name, or if it is one of the auto-imported Java classes by its unconditional name. References use the same dot notation as in Java, except that you must use $, not dot, to refer to the nested class.

I can find some examples here

JSON processing MEL does not have direct JSON support. json-to-object-transformer can turn JSON payload into a hierarchy of simple data structures that can be easily parsed with MEL. For example, the following uses a filtered projection to create an equivalent further

$..[?
(@.title=='Moby Dick')].price JSON path expression:
<json:json-to-object-transformer returnClass="java.lang.Object" />
<expression-transformer
 expression="#[($.price in message.payload if $.title == 'Moby Dick')[0]]" />

      

I want to understand in what cases $ get is used ...

+3


source to share


1 answer


$

derives from MVEL, the language behind MEL.

$ serves as a placeholder for the filtered item. it is actually a regular variable that exists within the context of the projection. You can also use it to return the current item in the projection to the representative list.



Link: http://mvel.codehaus.org/MVEL+2.0+Projections+and+Folds#MVEL2.0ProjectionsandFolds-Filters

+3


source







All Articles