SlideShare a Scribd company logo
1 of 9
MEL
MULE EXPRESSION LANGUAGE
EXPRESSION LANGUAGE
• An expression language, such as MEL, is similar, but not the same as, a scripting
language: it allows you to write short scripts that resolve dynamically to get
values, set values, or perform an operation on data. There is an overlap in
functionality between an expression language and a scripting language, but
scripting languages are generally more useful if you are writing something
complex enough to require more than just a few lines of code, or if you need to
include conditional logic. If, however, you need to get or set values, invoke
methods, or perform functions, you can do so quickly and easily using an
expression language.
MULE EXPRESSION LANGUAGE
• Mule specific lightweight language.
• It is use for accessing data in the mule message
(payload, variable, properties).
BENEFITS OF MEL
Once upon a time, when developing Mule applications, you would have had little other
option than to use a scripting language, such as Groovy, or a programming language
such as Java, to manipulate the contents of a message object. Though effective, using
these languages was not always efficient because there was no consistent, standardized
method for evaluating expressions.
Enter MEL, an expression language that provides a consistent, standardized way for
developers to work with a Mule message’s payload, properties and variables. It makes
use of Mule-specific context objects, it’s easy to use (auto-complete everywhere!) and it
behaves well when testing your application. Further, and most importantly, MEL enforces
consistency when accessing information on the message: rather than using multiple
expression evaluators, you can use MEL, the default expression evaluator, to consistently
access and manipulate information.
USING MEL
• It supports following types of operation:
• Extract information from the message.
• Evaluate conditions
• Define a target
EXTRACT INFORMATION FROM MESSAGE
• #[payload] – Return payload
• #[message.inboundProperties.'propertyName'] – return inbound property name
• #[payload.methodCall(parameters)] – return result of methodCall
• #[xpath3('//root/element1')] - evaluate xpath expression
EVALUATE CONDITIONS
• #[payload.age > 21] – return true if payload age is grater than 21.
• #[message.inboundProperties.'locale' == 'en_us']
DEFINE A TARGET
• #[flowVars.output] – access a variable name output.
• We can also do it in java. It has MuleMessage class as below:
• MuleMessage message = new MuleMessage();
• message.getinvocationProperty(“output”) – will return output as
string.
THANKS

More Related Content

What's hot

Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guideSindhu VL
 
Cloud hub architecture
Cloud hub architectureCloud hub architecture
Cloud hub architectureShanky Gupta
 
Mule message structure
Mule message structureMule message structure
Mule message structureSrilatha Kante
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in muleSindhu VL
 
Mule ESB
Mule ESBMule ESB
Mule ESBniravn
 
Mule developing a cloud hub application
Mule developing a cloud hub applicationMule developing a cloud hub application
Mule developing a cloud hub applicationD.Rajesh Kumar
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components pat_91
 
Using flows for service orchestration
Using flows for service orchestrationUsing flows for service orchestration
Using flows for service orchestrationSindhu VL
 
A Workhorse Named Mule
A Workhorse Named MuleA Workhorse Named Mule
A Workhorse Named MuleDavid Dossot
 
Overview of Mule
Overview of MuleOverview of Mule
Overview of Mulemdfkhan625
 
Anypoint platform architecture and components
Anypoint platform architecture and componentsAnypoint platform architecture and components
Anypoint platform architecture and componentsD.Rajesh Kumar
 

What's hot (19)

Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guide
 
Cloud hub architecture
Cloud hub architectureCloud hub architecture
Cloud hub architecture
 
Mule velocity
Mule velocityMule velocity
Mule velocity
 
Mule
MuleMule
Mule
 
Mule message structure
Mule message structureMule message structure
Mule message structure
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in mule
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
Mule UDP Transport
Mule UDP TransportMule UDP Transport
Mule UDP Transport
 
Mule developing a cloud hub application
Mule developing a cloud hub applicationMule developing a cloud hub application
Mule developing a cloud hub application
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components
 
Using flows for service orchestration
Using flows for service orchestrationUsing flows for service orchestration
Using flows for service orchestration
 
Mule: Java Component
Mule: Java ComponentMule: Java Component
Mule: Java Component
 
Mule esb overview
Mule esb overviewMule esb overview
Mule esb overview
 
A Workhorse Named Mule
A Workhorse Named MuleA Workhorse Named Mule
A Workhorse Named Mule
 
Overview of Mule
Overview of MuleOverview of Mule
Overview of Mule
 
Mule esb2
Mule esb2Mule esb2
Mule esb2
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule Esb
Mule EsbMule Esb
Mule Esb
 
Anypoint platform architecture and components
Anypoint platform architecture and componentsAnypoint platform architecture and components
Anypoint platform architecture and components
 

Viewers also liked

Main iita 072816 webinar 2 ppt
Main iita 072816 webinar 2 pptMain iita 072816 webinar 2 ppt
Main iita 072816 webinar 2 pptRick Still
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation FilterAnkush Sharma
 
Map-Reduce and Apache Hadoop
Map-Reduce and Apache HadoopMap-Reduce and Apache Hadoop
Map-Reduce and Apache HadoopSvetlin Nakov
 
Establishing thought leadership with content manufacturing and influencer mar...
Establishing thought leadership with content manufacturing and influencer mar...Establishing thought leadership with content manufacturing and influencer mar...
Establishing thought leadership with content manufacturing and influencer mar...Scott Abel
 
Рекомендовалка - Forbes
Рекомендовалка - ForbesРекомендовалка - Forbes
Рекомендовалка - ForbesAleksandr Tkachenko
 
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big DataVoxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big DataVoxxed Days Thessaloniki
 
The 1-2-3 of the Net Promoter System
The 1-2-3 of the Net Promoter SystemThe 1-2-3 of the Net Promoter System
The 1-2-3 of the Net Promoter SystemCloudcherry
 

Viewers also liked (18)

MRezaDjamil_CV
MRezaDjamil_CVMRezaDjamil_CV
MRezaDjamil_CV
 
Main iita 072816 webinar 2 ppt
Main iita 072816 webinar 2 pptMain iita 072816 webinar 2 ppt
Main iita 072816 webinar 2 ppt
 
Mule anypoint studio
Mule anypoint studioMule anypoint studio
Mule anypoint studio
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation Filter
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Who Is Daragh O Brien Online Cv
Who Is Daragh O Brien Online CvWho Is Daragh O Brien Online Cv
Who Is Daragh O Brien Online Cv
 
Mule Batch Commit
Mule Batch CommitMule Batch Commit
Mule Batch Commit
 
Filters in Mulesoft
Filters in MulesoftFilters in Mulesoft
Filters in Mulesoft
 
Map-Reduce and Apache Hadoop
Map-Reduce and Apache HadoopMap-Reduce and Apache Hadoop
Map-Reduce and Apache Hadoop
 
Mule google connectors
Mule google connectorsMule google connectors
Mule google connectors
 
Advanced coupon class
Advanced coupon classAdvanced coupon class
Advanced coupon class
 
Establishing thought leadership with content manufacturing and influencer mar...
Establishing thought leadership with content manufacturing and influencer mar...Establishing thought leadership with content manufacturing and influencer mar...
Establishing thought leadership with content manufacturing and influencer mar...
 
DAL
DALDAL
DAL
 
Ibotta Case Study
Ibotta Case StudyIbotta Case Study
Ibotta Case Study
 
Рекомендовалка - Forbes
Рекомендовалка - ForbesРекомендовалка - Forbes
Рекомендовалка - Forbes
 
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big DataVoxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
 
Apache Hadoop 3.0 What's new in YARN and MapReduce
Apache Hadoop 3.0 What's new in YARN and MapReduceApache Hadoop 3.0 What's new in YARN and MapReduce
Apache Hadoop 3.0 What's new in YARN and MapReduce
 
The 1-2-3 of the Net Promoter System
The 1-2-3 of the Net Promoter SystemThe 1-2-3 of the Net Promoter System
The 1-2-3 of the Net Promoter System
 

Similar to Mule expression language

Similar to Mule expression language (20)

A short introduction on mule expression language
A short introduction on mule expression languageA short introduction on mule expression language
A short introduction on mule expression language
 
Mule mel 1
Mule mel 1Mule mel 1
Mule mel 1
 
Mule expression language - Part 1
Mule expression language - Part 1Mule expression language - Part 1
Mule expression language - Part 1
 
Mule slides
Mule slides Mule slides
Mule slides
 
Mule esb kranthi
Mule esb kranthiMule esb kranthi
Mule esb kranthi
 
Mule esb kranthi
Mule esb kranthiMule esb kranthi
Mule esb kranthi
 
Mule esb
Mule esb Mule esb
Mule esb
 
Mule
MuleMule
Mule
 
Esb process
Esb processEsb process
Esb process
 
Mule
MuleMule
Mule
 
Sai mule esb batch
Sai mule esb batchSai mule esb batch
Sai mule esb batch
 
Ashok mule esb
Ashok mule esbAshok mule esb
Ashok mule esb
 
Meetup hyderabad mule-4.x
Meetup hyderabad mule-4.xMeetup hyderabad mule-4.x
Meetup hyderabad mule-4.x
 
Mule esb naveen
Mule esb naveenMule esb naveen
Mule esb naveen
 
Niranjan mule esb
Niranjan mule esbNiranjan mule esb
Niranjan mule esb
 
Mule esb
Mule esbMule esb
Mule esb
 
Srilekha mule esb
Srilekha mule esbSrilekha mule esb
Srilekha mule esb
 
What is Mule ESB
What is Mule ESB What is Mule ESB
What is Mule ESB
 
Mini-Training: Message Brokers
Mini-Training: Message BrokersMini-Training: Message Brokers
Mini-Training: Message Brokers
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in mule
 

More from krishashi

More from krishashi (12)

Error handling
Error handlingError handling
Error handling
 
Mule validators
Mule validatorsMule validators
Mule validators
 
Mule filters
Mule filtersMule filters
Mule filters
 
Http connector
Http connectorHttp connector
Http connector
 
Variable
VariableVariable
Variable
 
Datamapper
DatamapperDatamapper
Datamapper
 
Java component
Java componentJava component
Java component
 
Variable
VariableVariable
Variable
 
Logger
LoggerLogger
Logger
 
Set payload
Set payloadSet payload
Set payload
 
File connector
File connectorFile connector
File connector
 
Dataweave
DataweaveDataweave
Dataweave
 

Recently uploaded

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Recently uploaded (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Mule expression language

  • 2. EXPRESSION LANGUAGE • An expression language, such as MEL, is similar, but not the same as, a scripting language: it allows you to write short scripts that resolve dynamically to get values, set values, or perform an operation on data. There is an overlap in functionality between an expression language and a scripting language, but scripting languages are generally more useful if you are writing something complex enough to require more than just a few lines of code, or if you need to include conditional logic. If, however, you need to get or set values, invoke methods, or perform functions, you can do so quickly and easily using an expression language.
  • 3. MULE EXPRESSION LANGUAGE • Mule specific lightweight language. • It is use for accessing data in the mule message (payload, variable, properties).
  • 4. BENEFITS OF MEL Once upon a time, when developing Mule applications, you would have had little other option than to use a scripting language, such as Groovy, or a programming language such as Java, to manipulate the contents of a message object. Though effective, using these languages was not always efficient because there was no consistent, standardized method for evaluating expressions. Enter MEL, an expression language that provides a consistent, standardized way for developers to work with a Mule message’s payload, properties and variables. It makes use of Mule-specific context objects, it’s easy to use (auto-complete everywhere!) and it behaves well when testing your application. Further, and most importantly, MEL enforces consistency when accessing information on the message: rather than using multiple expression evaluators, you can use MEL, the default expression evaluator, to consistently access and manipulate information.
  • 5. USING MEL • It supports following types of operation: • Extract information from the message. • Evaluate conditions • Define a target
  • 6. EXTRACT INFORMATION FROM MESSAGE • #[payload] – Return payload • #[message.inboundProperties.'propertyName'] – return inbound property name • #[payload.methodCall(parameters)] – return result of methodCall • #[xpath3('//root/element1')] - evaluate xpath expression
  • 7. EVALUATE CONDITIONS • #[payload.age > 21] – return true if payload age is grater than 21. • #[message.inboundProperties.'locale' == 'en_us']
  • 8. DEFINE A TARGET • #[flowVars.output] – access a variable name output. • We can also do it in java. It has MuleMessage class as below: • MuleMessage message = new MuleMessage(); • message.getinvocationProperty(“output”) – will return output as string.