Upload
abhipokharna
View
180
Download
0
Embed Size (px)
Citation preview
Abhishek Jain
List and Maps MEL Benefits Different Ways of using MEL Topic for next session Reference
A Simple Map can be created using below MEL expression example:
[‘firstname’: ‘Abhi’, ‘lastname’:’jain’]
The above example will create a map having two properties (firstname, lastname) with the values as (Abhi, jain) respectively
On the same way arrays (Collection of Maps) can also be created[
[‘firstname’: ‘Abhi’, ‘lastname’:’jain’][‘firstname’: ‘Montu’, ‘lastname’:’jain’][‘firstname’: ‘John’, ‘lastname’:’ anderson’]
]
-An Expression language which provides a consistent and standardized way to
developers
-Can be used easily with mule message, inbound/outbound properties, Variables
-Easy to use
-Works within message processors to decide the message routes
-Used for extracting the information
-No need to remember large syntaxes
-
MEL expression can be used for extracting the data and then decide the next course of action i.e. these can be pretty much used inside choice routers for directing the messages to different routes
Small example:
<choice> <when expression="#[payload.getFlightName() == ‘Delta']">
<flow-ref name==“DeltaAirLinesProcess" /> </when> <when expression="#[payload.getFlightName() == ‘United’']">
<flow-ref name==“UnitedAirLinesProcess" /> </when>
</choice>
MEL Can be used for extracting the values from payload, properties or context.
For example
You have several flow variables which are set (like to, cc, from, body) for sending email message.
You can extract all the info and set it while working with one processor
<smtp:outbound-endpoint from="#[flowVars.from]" to="#[flowVars.to]" subject="#[payload.subjectLine]" responseTimeout="10000" doc:name="SMTP"/>
Debugging in Anypoint Studio
www.mulesoft.com Mule in Action