SlideShare a Scribd company logo
1 of 12
Karthik Selvaraj
Introduction
 Mule Expression Language (MEL) was introduced in
Mule 3.3.0
 Prior to version 3.3.0, expressions in Mule varied in
syntax according to their specific evaluator.
 The variation in syntax rules was time-consuming to
learn and hence MEL was created to address this
complexity.
 Mule Expression Language (MEL), implements a
single set of syntax rules.
Expression VS Scripting 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.
 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 you need to get or set values, invoke methods, or
perform functions, you can do so quickly and easily
using an expression language.
MEL – Assigning Values
 Point the cursor to value field and press CTRL + Space
key to get the list of values to assign
MEL Context Objects
 Context Objects
 server: this object provides access to the fields for the
hardware, operating system, user, and network
interface.
 mule: this object provides access to the fields for your
Mule instance.
 app: this object provides access to the fields of your
Mule application.
 message: this object provides access to the fields of the
Mule message.
MEL Variables
 Variables
 flowVars
 sessionVars
 Usage
 flowVars
 #[flowVars.firstname = Karthik]
 sessionVars
 #[sessionVars.lastname = Selvaraj]
MEL Variable
 You can use the variable name directly in a MEL
expression
 #[firstname] is equivalent to #[flowVars.firstname]
 #[lastname] is equivalent to #[sessionVars.lastname]
 Mule assumes that it is a flowVars and, when MEL
evaluates the expression, looks for a variable by that
name. If Mule cannot find a flowVars by that name, it
looks for a sessionVars by that name before failing.
MEL Variable
 If you wish to disable this auto-resolution of variables
by name, please include the below flow configuration
xml
 <configuration> <expression-language
autoResolveVariables="false"/> </configuration>
MEL Variable
Reference
 https://docs.mulesoft.com/mule-user-
guide/v/3.7/mule-expression-language-mel
 https://docs.mulesoft.com/mule-user-
guide/v/3.6/mule-expression-language-basic-syntax
 https://docs.mulesoft.com/mule-user-
guide/v/3.6/mule-expression-language-reference
 https://docs.mulesoft.com/mule-user-
guide/v/3.6/mule-expression-language-examples
 https://docs.mulesoft.com/mule-user-
guide/v/3.7/mule-expression-language-tips
Reference
 http://blogs.mulesoft.com/wp-
content/uploads/2012/12/refcard-mel.pdf
 https://dzone.com/articles/mule-expression-
language-cheat
Mule Expression Language
THANK YOU

More Related Content

What's hot

What's hot (19)

Mule security - saml
Mule  security - samlMule  security - saml
Mule security - saml
 
Mule security
Mule securityMule security
Mule security
 
Generating Documentation for Mule ESB Application
Generating Documentation for Mule ESB ApplicationGenerating Documentation for Mule ESB Application
Generating Documentation for Mule ESB Application
 
Mule testing
Mule   testingMule   testing
Mule testing
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
Mule management console Architecture
Mule management console ArchitectureMule management console Architecture
Mule management console Architecture
 
Mule edifact module
Mule edifact moduleMule edifact module
Mule edifact module
 
Junit in mule demo
Junit in mule demoJunit in mule demo
Junit in mule demo
 
Mule security - saml
Mule  security - samlMule  security - saml
Mule security - saml
 
Mule esb transformers
Mule esb transformersMule esb transformers
Mule esb transformers
 
Mule Message Chunk Splitter
Mule Message Chunk SplitterMule Message Chunk Splitter
Mule Message Chunk Splitter
 
Mule security
Mule  securityMule  security
Mule security
 
Mulesoft debug
Mulesoft debugMulesoft debug
Mulesoft debug
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in mule
 
MUnit - Testing Mule
MUnit - Testing MuleMUnit - Testing Mule
MUnit - Testing Mule
 
Mule system properties
Mule system propertiesMule system properties
Mule system properties
 
Dataweave
Dataweave Dataweave
Dataweave
 
Mule ESB - Intra application communication
Mule ESB - Intra application communicationMule ESB - Intra application communication
Mule ESB - Intra application communication
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
 

Viewers also liked

Viewers also liked (6)

Mule error handling
Mule error handlingMule error handling
Mule error handling
 
Anypoint mq (mulesoft) pub sub model
Anypoint mq (mulesoft)  pub sub modelAnypoint mq (mulesoft)  pub sub model
Anypoint mq (mulesoft) pub sub model
 
Ruby in mule
Ruby in muleRuby in mule
Ruby in mule
 
Designing rest with raml part3
Designing rest with raml part3Designing rest with raml part3
Designing rest with raml part3
 
Data weave component
Data weave componentData weave component
Data weave component
 
Latest Blouse Back Neck Designs & Patterns 2016
Latest Blouse Back Neck Designs & Patterns 2016Latest Blouse Back Neck Designs & Patterns 2016
Latest Blouse Back Neck Designs & Patterns 2016
 

Similar to Mule expression language - Part 1

Similar to Mule expression language - Part 1 (20)

Expression language
Expression languageExpression language
Expression language
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in mule
 
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 Expression language
Mule Expression languageMule Expression language
Mule Expression language
 
Mule expression language
Mule expression languageMule expression language
Mule expression language
 
Mule expression language
Mule expression languageMule expression language
Mule expression language
 
Mule mel 1
Mule mel 1Mule mel 1
Mule mel 1
 
Session 05 – mel and expression
Session 05 – mel and expressionSession 05 – mel and expression
Session 05 – mel and expression
 
LML to SysML and Back - Systems Engineering Languages
LML to SysML and Back - Systems Engineering LanguagesLML to SysML and Back - Systems Engineering Languages
LML to SysML and Back - Systems Engineering Languages
 
Mule Splitter Flow Control Reference
Mule Splitter Flow Control ReferenceMule Splitter Flow Control Reference
Mule Splitter Flow Control Reference
 
Muleexpressiontransformer by nagarjuanreddy
Muleexpressiontransformer by nagarjuanreddyMuleexpressiontransformer by nagarjuanreddy
Muleexpressiontransformer by nagarjuanreddy
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
Cursors.ppt
Cursors.pptCursors.ppt
Cursors.ppt
 
Mule architecture
Mule   architectureMule   architecture
Mule architecture
 
Mule architecture
Mule   architectureMule   architecture
Mule architecture
 
Top 50 MuleSoft interview questions
Top 50 MuleSoft interview questionsTop 50 MuleSoft interview questions
Top 50 MuleSoft interview questions
 
Elements in a muleflow
Elements in a muleflowElements in a muleflow
Elements in a muleflow
 
Elements in a mule flow
Elements in a mule flowElements in a mule flow
Elements in a mule flow
 
SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE
SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE
SL5 OBJECT: SIMPLER LEVEL 5 OBJECT EXPERT SYSTEM LANGUAGE
 
MASRML - A DOMAIN-SPECIFIC MODELING LANGUAGE FOR MULTI-AGENT SYSTEMS REQUIREM...
MASRML - A DOMAIN-SPECIFIC MODELING LANGUAGE FOR MULTI-AGENT SYSTEMS REQUIREM...MASRML - A DOMAIN-SPECIFIC MODELING LANGUAGE FOR MULTI-AGENT SYSTEMS REQUIREM...
MASRML - A DOMAIN-SPECIFIC MODELING LANGUAGE FOR MULTI-AGENT SYSTEMS REQUIREM...
 

Recently uploaded

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
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
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.pptx
Earley Information Science
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
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...
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Mule expression language - Part 1

  • 2. Introduction  Mule Expression Language (MEL) was introduced in Mule 3.3.0  Prior to version 3.3.0, expressions in Mule varied in syntax according to their specific evaluator.  The variation in syntax rules was time-consuming to learn and hence MEL was created to address this complexity.  Mule Expression Language (MEL), implements a single set of syntax rules.
  • 3. Expression VS Scripting 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.  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 you need to get or set values, invoke methods, or perform functions, you can do so quickly and easily using an expression language.
  • 4. MEL – Assigning Values  Point the cursor to value field and press CTRL + Space key to get the list of values to assign
  • 5. MEL Context Objects  Context Objects  server: this object provides access to the fields for the hardware, operating system, user, and network interface.  mule: this object provides access to the fields for your Mule instance.  app: this object provides access to the fields of your Mule application.  message: this object provides access to the fields of the Mule message.
  • 6. MEL Variables  Variables  flowVars  sessionVars  Usage  flowVars  #[flowVars.firstname = Karthik]  sessionVars  #[sessionVars.lastname = Selvaraj]
  • 7. MEL Variable  You can use the variable name directly in a MEL expression  #[firstname] is equivalent to #[flowVars.firstname]  #[lastname] is equivalent to #[sessionVars.lastname]  Mule assumes that it is a flowVars and, when MEL evaluates the expression, looks for a variable by that name. If Mule cannot find a flowVars by that name, it looks for a sessionVars by that name before failing.
  • 8. MEL Variable  If you wish to disable this auto-resolution of variables by name, please include the below flow configuration xml  <configuration> <expression-language autoResolveVariables="false"/> </configuration>
  • 10. Reference  https://docs.mulesoft.com/mule-user- guide/v/3.7/mule-expression-language-mel  https://docs.mulesoft.com/mule-user- guide/v/3.6/mule-expression-language-basic-syntax  https://docs.mulesoft.com/mule-user- guide/v/3.6/mule-expression-language-reference  https://docs.mulesoft.com/mule-user- guide/v/3.6/mule-expression-language-examples  https://docs.mulesoft.com/mule-user- guide/v/3.7/mule-expression-language-tips