Download - Mule soft mel_day2
![Page 1: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/1.jpg)
Abhishek Jain
![Page 2: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/2.jpg)
Use of MEL Access Object Level Properties Access Method Level Properties Operators Operators Evaluation Data Extraction Topic for next session Reference
![Page 3: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/3.jpg)
![Page 4: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/4.jpg)
-In the previous slide example, MEL is calling the inbound
property from the mule message for the value of “Host”
-All properties are stored in Map
-There are two ways to access them
-#[message.getInboundProperty(‘host’)]
-#[message.InboundProperties[‘host’]]
-In order to access Mule Registry, use below expression
-#[app.registry]
![Page 5: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/5.jpg)
If payload is of type java objectthen properties can be accessed directly by calling the fieldname from payload.
For example, payload is of CustomerDetails object and want to access lastname then use the below expression
#[payload.lastName]
![Page 6: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/6.jpg)
If payload is of type java objectthen methods can also be triggered using MEL
For example, payload is of CustomerDetails object and want to trigger getFirstName method then use below expressiono
#[payload.getFirstName()]
![Page 7: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/7.jpg)
#[‘hello’ + ‘John’] => Hello John
![Page 8: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/8.jpg)
Standard Comparison Operators:
==, !=, >, <, >=, =<
Contains – Similar to like Operator
Is- Checks the type of an object
Mainly used in Choice Router
![Page 9: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/9.jpg)
#[xpath(‘expression’)] #[regex(‘expression’)]
![Page 10: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/10.jpg)
List/Maps in MEL
![Page 12: Mule soft mel_day2](https://reader036.vdocuments.us/reader036/viewer/2022070600/58a3eeeb1a28ab272e8b5fdf/html5/thumbnails/12.jpg)