SlideShare une entreprise Scribd logo
1  sur  16
Expression Language
in Mule
Mule Expression Language(MEL) - Introduction
 Mule Expression Language (MEL) supports the work of message processors by
providing a means of accessing, manipulating, and using information from the
message and its environment.
 In most cases, Mule expressions work within message processors to modify the
way those processors do their main jobs (for example, routing, filtering). Following
are the principal use cases:
 Make a decision based on the contents, properties, or context of a message and its
attachments. For example, a flow controller can route purchase orders for different
types of products to different JMS queues.
 Select a value from the contents, properties, or context of a message and its
attachments. For example, a cloud connector might extract a specific piece of
information from the current message to use as an argument.
 Replace a token with an actual value. For example, a logger can extract information
from the payload contents and place it into a logging message.
 We can also use MEL to implement a program (script) for which we would
otherwise use a programming language like Ruby, JavaScript, or Groovy. Scripts in
those languages cannot access the message and its environment as conveniently
as MEL can. In this case, MEL is the programming language for a custom message
processor.
Mule Expression Language - Syntax
Mule Expression Language Syntax
 MEL expression combines one or more operands with zero or more operators in a Java-like
syntax and returns the resulting value.
 At the heart of MEL are property expressions of the form contextObject.property. These
provide easy access to properties of the Mule message and its environment. For example,
the expression “message.payload” represents the payload property of the message context
object. Its value is the message payload.
 Java method invocations and assignments are the other common MEL expressions.
 In most cases, a MEL expression stands alone as the value of a configuration property of a
message processor. Mule evaluates the expression at runtime, and the message processor
uses the result.
 The syntax of a MEL program largely follows Java, but MEL implements dynamic typing by
performing type coercion at runtime. Semicolons follow each statement except the last,
whether the statements are on one line or separate lines. Return statements are usually
unnecessary, because a MEL program returns the value of the last MEL statement executed.
 MEL operators and basic operands are conventional and predictable (for example, 2 + 2 == 4
returns true). Property expressions provide convenient access to information from the
message and its environment (for example, server.fileSeparator returns "/" if the application
is running on a Linux server, and "" on a Windows server.). The remainder of this section
summarizes the most important elements of MEL syntax.
Mule Expression Language – Operand, Property
MEL Operand
 An operand can be a literal, a variable, or a MEL expression.
 The MEL expressions that most commonly appear as operands are property expressions and
method invocations.
Property Expressions
 The syntax of a property expression is “contextObject.property”. This can appear as an operand in
most MEL expressions, including on the left side of an assignment if the property is writable from
MEL.
Method Invocations
 Mule Expression Language uses standard Java method invocation.
 We can provide a fully qualified class name or import a class and use the unqualified name. MEL
automatically imports a number of Java classes.
 Eg. message.payload.getName(). If payload is a Java object—for example, representing a person—
this code invokes its getName method. The value of the expression is the value that getName
returns—presumably a string representing the person’s name.
MEL Operators
 MEL operators follow standard Java syntax, but operands are always by value, not by reference. For
example, "A" == 'A' evaluates to true, whereas the same expression evaluates to false in Java.
Arithmetic Operators
Mule Expression Language – Arithmetic Operators
Symbol Definition Example/Value
-
Minus. The value is the value of the first operand minus the
value of the second.
2 - 4
-2
%
Modulo. The value is the remainder after dividing the value
of the first operand by the value of the second.
9 % 4
1
/
Over. The value is the value of the first operand divided by
the value of the second.
2 / 4
0.5
+
Plus. For numbers, the value is the sum of the values of the
operands. For strings, the value is the string formed by
concatenating the values of the operands.
2 + 4
6
'fu' + 'bar'
The String "fubar"
*
Times. The value is the product of the values of the
operands.
2 * 4
8
Comparison Operators
Mule Expression Language – Comparison Operators
Symbol Definition Example/Value
==
Equal. True if and only if (iff) the values of the operands are
equal.
'A' == 'A'
true
!= Not equal. True iff the values of the operands are unequal.
'A' != 'B'
true
>
Greater than. True iff the value on the left is greater than the
value on the right.
7 > 5
true
<
Less than. True iff the value on the left is less than the value
on the right
5 < 5
false
>=
Greater than or equal. True iff the value on the left is greater
than or equal to the value on the right.
5 >= 7
false
<=
Less than or equal. True iff the value on the left is less than or
equal to the value on the right.
5 <= 5
true
contains
Contains. True iff the string on the right is a substring of the
string on the left.
'fubar' contains
'bar'
true
is,
instance
of
Is an instance of. True iff the object on the left is an instance
of the class on the right.
'fubar' is String
true
Comparison Operators - contd
Logical Operators
Mule Expression Language – Logical Operators
Symbol Definition Example/Value
strsim
Degree of similarity. The value of the expression is a
number between 0 and 1 representing the degree of
similarity between the two string arguments.
'foo' strsim 'foo'
1.0
‘foobar’ strsim ‘foo’
0.5
soundslike
Sounds like. True iff the two string arguments sound alike
according to a Soundex comparison.
'Robert' soundslike
'Rupert'
true
Symbol Definition Example/Value
and
Logical AND. True iff both operands are true. (Don’t use
&&)
(a == b) and (c != d)
true iff a =b and c ≠ d
|| Logical OR. True iff at least one operand is true.
true ||anything
Always true
or
Chained OR. Scans left to right and returns the value of
the first non-empty item
false or '' or ' ' or 'dog'
The String "dog"
Mule Expression Language – Assignment, Literals
MEL Assignment
 An assignment is a MEL expression consisting of an identifier representing a mutable object to the
left of an equal sign and a MEL expression to the right of the equal sign. Eg: message.payload = 'fu‘
sets the payload of the current message to the string "fu".
 MEL determines types dynamically, so declaring the type of a variable is optional. For example if,
with no prior declarations, if we write number = 1; number == '1' MEL assigns the expression the
value true.
 We can cast values to specific types. For example if we write
number = (String)1; number is String
MEL returns the value true for this expression.
MEL Literals
 Literals in MEL can be strings, numbers, Boolean values, types, and nulls. Maps, Lists and Arrays
data structures as literals as well.
MEL Literals – Numeric Literals
 Numeric literals are integers and floating point numbers, with the same ranges of values as the
underlying Java system.
MEL Literals – String Literals
 String literals are sequences of characters enclosed in single quotes. We cannot use double quotes
to express String literals as we can in Java, because MEL expressions appear within double quotes
in configuration files.
Mule Expression Language – Literals
MEL Literals – Boolean Literals
 Boolean literals are the values true and false. These are case sensitive.
MEL Literals – Null Literals
 A null literal takes the form null or nil. These are case sensitive.
MEL Literals – Type Literals
 Refer to any Java class by its fully qualified name or if it is one of the classes in the below classes, by its unqualified name.
References use the same dot notation as in Java, except that we must use $ rather than a dot to refer to a nested class.
 MEL automatically imports the following Java classes.
 java.lang.*
 java.io.*
 java.net.*
 java.util.*
 java.math.BigDecimal
 java.math.BigInteger
 javax.activation.DataHandler
 javax.activation.MimeType
 java.util.regex.Pattern
 org.mule.api.transformer.DataType
 org.mule.transformer.types.DataTypeFactory
MEL Key/Value Maps, Lists, and Arrays
 Maps are important in Mule Expression Language because much of the context you can work with comes in the form of
maps.
Mule Expression Language – Maps, Lists and Arrays
MEL Key/Value Maps, Lists, and Arrays
 Mule Expression Language uses a convenient syntax for maps and other data structures. It begins
with map literals, and there is also a convenient way to access items in maps. MEL provides a
streamlined way to access map data. Rather than constructing a map with a new statement, and
then using its put method to populate it, we can simply write the following:
[key1 : value1, key2 : value2, . . .]
and use this literal form wherever we would otherwise use a map by name, including as a
method argument.
 similar literal forms for lists ([item1, item2, . . .]) and arrays ({item1, item2, . . .}).
 Arrays in Java must specify the type of their contents, but in MEL they are untyped. MEL supplies
the correct type when we use them – either by determining it at compile time or coercing the
array to the correct type at run time.
Accessing Map Data
 MEL provides a simpler way to access map items than java.util.Map provides. For example, Mule
associates a map containing properties set by the inbound endpoint processor with each message.
We can refer to this map as message.inboundProperties. To retrieve the inbound property with key
name foo, write 'message.inboundProperties[foo]'. If that property can be set (never the case with
inbound properties, but true of some properties in other maps), we can write
message.outboundProperties[foo]=message.payload on the left side of an assignment. If we try to
set a property that cannot be set,Mule indicates failure by throwing
org.mvel2.PropertyAccessException.
Mule Expression Language–Control Flow, Context Objects
Control Flow
 MEL provides a full range of Java control flow statements. The most useful for typical MEL
expressions are conditional operands (often called ternary statements).
 A conditional operand has the form condition ? true value : false value.
For example, x = (name == 'Smith' ? 'Smith' : 'Unknown') sets the variable x to the string "Smith" if the
value of name is "Smith" and to the string "Unknown" if the value of name is not "Smith".
MEL Context Objects and Functions
 Property expressions facilitate the use of properties of the Mule message and its environment as
operands in MEL expressions. They take the form contextObject.property. Context objects provide
logical groupings of the properties of the message and its environment.
 Functions provide ways to extract information that doesn’t already exist as a single value that can
be embodied in a property.
MEL Context Objects
 Context objects model the message and its environment. They make MEL Mule-centric, not just
another expression language. Different context objects are
 Server: properties of the hardware, operating system, user, and network interface.
 Mule: properties of the Mule instance.
 App: properties of the Mule application.
 Message: properties of the Mule message - [DEFAULT]
Mule Expression Language – Context Object - Server
Server
 This object provides read-only access to the properties of the hardware, operating system, user, and
network interface listed in the table.
 For example, the value of 'server.userName' is a string representing the name of the user.
Name Description
fileSeparator
Character that separates components of a file path ( "/" on UNIX and ""
on Windows)
host Fully qualified domain name of the server
ip The IP address of the server
locale
Default locale (of type java.util.Locale) of the JRE (can access
server.locale.language and server.locale.country)
javaVersion JRE version
javaVendor JRE vendor name
osName Operating system name
osArch Operating system architecture
osVersion Operating system version
systemProperties Map of Java system properties
timeZone Default TimeZone (java.util.TimeZone) of the JRE
tmpDir Temporary directory for use by the JRE
userName User name
userHome User home directory
userDir
User working directory.For example, the value of 'server.userName' is a
string representing the name of the user.
Mule Expression Language – Context Object – Mule, App
Mule
 This object provides read-only access to the properties of the Mule instance listed in the
table.
 For example, the value of 'mule.version' is a string representing the Mule version.
App
 This object provides access to the properties of the Mule application listed in the table
 For example, the value of 'app.name' is a string representing the application name.
 For example, 'app.registry['foo']' refers to the object named foo in the Mule registry map.
You can set or retrieve its value.
Name Description
clusterId Cluster ID
home File system path to the home directory of the mule server installation
nodeId Cluster node ID
version Mule Version
Name Description
encoding Application default encoding (read-only)
name Application name (read-only)
standalone True if Mule is running standalone (read-only)
workdir Application work directory (read-only)
registry
Map representing the Mule registry (read/write).For example, the value of 'app.name' is a string
representing the application name.For example, 'app.registry['foo']' refers to the object named foo
the Mule registry map. You can set or retrieve its value.
Mule Expression Language – Context Object – Message
Message
 This object provides access to the properties of the Mule message listed in the table.
Name Description
id (read-only)
rootId (read-only)
correlationId (read-only)
correlationSequence (read-only)
correlationGroupSize (read-only)
replyTo (read/write)
dataType (read-only)
payload (read/write)
inboundProperties Map (read-only)
inboundAttachments Map (read-only)
outboundProperties Map (read/write)
outboundAttachments Map (read/write)
exception (read-only)
Mule Expression Language – Variables
Variables
 In addition to local MEL variables, whose scope is the current message processor, MEL gives you access to
Mule flow and session variables. The variables reside in the following maps, which are available to use in
MEL expressions:
 flowVars – contains variables that are global to the current flow. They retain their values as control passes from one message processor to
another. Thus, you can set them in one message processor and use them in another.
 SessionVars – is essentially the same as flowVars, except that when one flow calls another one via a Mule endpoint they are propagated.
 For example, to access the value of the foo flow variable, write flowVars['foo']. This can appear on either
side of an assignment. For example, the following code gets the value of the session variable bar and uses
it to set the value of the flow variable bar.
flowVars['foo'] = sessionVars['bar']
 As a further shortcut, you can simply use foo as a variable name in a MEL expression. If there is no
local MEL variable called foo, the MEL processor looks for one in flowVars, then in sessionVars, before
failing. For example, if the MEL expression contains foo == 'cat' and there is no local MEL variable named
foo, but there is a foo key in flowVars, then the foo in the expression is equivalent to flowVars['foo'].
 Note, however, that we can turn this method of resolution off by including a configuration attribute in the
xml configuration file:
<configuration>
<expression-language autoResolveVariables="false">
</configuration>
Mule Expression Language – Data Extraction Function
Data Extraction Function
 The functions xpath and regex provide ways of extracting context information extract
information that doesn’t already exist as a single value that can be embodied in a property.
By default they work on the payload, but we can pass them different arguments explicitly.

Contenu connexe

Tendances

Tendances (15)

Muleexpressiontransformer by nagarjuanreddy
Muleexpressiontransformer by nagarjuanreddyMuleexpressiontransformer by nagarjuanreddy
Muleexpressiontransformer by nagarjuanreddy
 
Mule rabbit mq
Mule rabbit mqMule rabbit mq
Mule rabbit mq
 
Mule: Java Component
Mule: Java ComponentMule: Java Component
Mule: Java Component
 
Mule messages and transformers
Mule messages and transformersMule messages and transformers
Mule messages and transformers
 
Mule esb2
Mule esb2Mule esb2
Mule esb2
 
Mule message
Mule messageMule message
Mule message
 
Mule esb kranthi
Mule esb kranthiMule esb kranthi
Mule esb kranthi
 
Ashok mule esb
Ashok mule esbAshok mule esb
Ashok mule esb
 
Sai mule esb batch
Sai mule esb batchSai mule esb batch
Sai mule esb batch
 
Mule slides
Mule slides Mule slides
Mule slides
 
Types of MessageRouting in Mule
Types of MessageRouting in MuleTypes of MessageRouting in Mule
Types of MessageRouting in Mule
 
Niranjan mule esb
Niranjan mule esbNiranjan mule esb
Niranjan mule esb
 
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To  Classes, Objects, & StringsIntro To C++ - Class 05 - Introduction To  Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
 
Command pattern
Command patternCommand pattern
Command pattern
 
Mule UDP Transport
Mule UDP TransportMule UDP Transport
Mule UDP Transport
 

En vedette

Message processor in mule
Message processor in muleMessage processor in mule
Message processor in muleSon Nguyen
 
Introduction java messaging services
Introduction java messaging servicesIntroduction java messaging services
Introduction java messaging servicesSon Nguyen
 
Using map and list starter
Using map and list starterUsing map and list starter
Using map and list starterSon Nguyen
 
Adding dynamic file
Adding dynamic fileAdding dynamic file
Adding dynamic fileSon Nguyen
 
Accessing jms by groovy
Accessing jms by groovyAccessing jms by groovy
Accessing jms by groovySon Nguyen
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with muleSon Nguyen
 
Multi database access
Multi database accessMulti database access
Multi database accessSon Nguyen
 
Request in mule
Request in muleRequest in mule
Request in muleSon Nguyen
 
Mule and web services
Mule and web servicesMule and web services
Mule and web servicesvenureddymasu
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with muleSon Nguyen
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in muleSon Nguyen
 
Using groovy in mule
Using groovy in muleUsing groovy in mule
Using groovy in muleSon Nguyen
 
Encrypt The Mule Message With Anypoint JCE and XML Encrypter
Encrypt The Mule Message With Anypoint JCE and XML EncrypterEncrypt The Mule Message With Anypoint JCE and XML Encrypter
Encrypt The Mule Message With Anypoint JCE and XML EncrypterJitendra Bafna
 
Clustering concepts
Clustering conceptsClustering concepts
Clustering conceptsbapiraju
 
Mule idempotent filter and Object Store
Mule idempotent filter and Object StoreMule idempotent filter and Object Store
Mule idempotent filter and Object StoreAnirban Sen Chowdhary
 
Mule - error handling
Mule - error handling Mule - error handling
Mule - error handling Sindhu VL
 

En vedette (20)

Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
 
Introduction java messaging services
Introduction java messaging servicesIntroduction java messaging services
Introduction java messaging services
 
Using map and list starter
Using map and list starterUsing map and list starter
Using map and list starter
 
Adding dynamic file
Adding dynamic fileAdding dynamic file
Adding dynamic file
 
Accessing jms by groovy
Accessing jms by groovyAccessing jms by groovy
Accessing jms by groovy
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with mule
 
Xml transform
Xml transformXml transform
Xml transform
 
Multi database access
Multi database accessMulti database access
Multi database access
 
Request in mule
Request in muleRequest in mule
Request in mule
 
Mule and web services
Mule and web servicesMule and web services
Mule and web services
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with mule
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
 
Using groovy in mule
Using groovy in muleUsing groovy in mule
Using groovy in mule
 
Mule with quartz
Mule with quartzMule with quartz
Mule with quartz
 
Encrypt The Mule Message With Anypoint JCE and XML Encrypter
Encrypt The Mule Message With Anypoint JCE and XML EncrypterEncrypt The Mule Message With Anypoint JCE and XML Encrypter
Encrypt The Mule Message With Anypoint JCE and XML Encrypter
 
Clustering concepts
Clustering conceptsClustering concepts
Clustering concepts
 
Mule idempotent filter and Object Store
Mule idempotent filter and Object StoreMule idempotent filter and Object Store
Mule idempotent filter and Object Store
 
Running mule from java
Running mule from javaRunning mule from java
Running mule from java
 
Mule esb presentation
Mule esb presentationMule esb presentation
Mule esb presentation
 
Mule - error handling
Mule - error handling Mule - error handling
Mule - error handling
 

Similaire à Expression language in mule

Mule expression language - Part 1
Mule expression language - Part 1Mule expression language - Part 1
Mule expression language - Part 1Karthik Selvaraj
 
Introduction to Erlang
Introduction to ErlangIntroduction to Erlang
Introduction to ErlangRaymond Tay
 
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 languageSwapnil Sahu
 
Session 05 – mel and expression
Session 05 – mel and expressionSession 05 – mel and expression
Session 05 – mel and expressionTrí Bằng
 
Handout # 4 functions + scopes
Handout # 4   functions + scopes Handout # 4   functions + scopes
Handout # 4 functions + scopes NUST Stuff
 
Scala Language Intro - Inspired by the Love Game
Scala Language Intro - Inspired by the Love GameScala Language Intro - Inspired by the Love Game
Scala Language Intro - Inspired by the Love GameAntony Stubbs
 
Is there a perfect data-parallel programming language? (Experiments with More...
Is there a perfect data-parallel programming language? (Experiments with More...Is there a perfect data-parallel programming language? (Experiments with More...
Is there a perfect data-parallel programming language? (Experiments with More...Julian Hyde
 
The future of DSLs - functions and formal methods
The future of DSLs - functions and formal methodsThe future of DSLs - functions and formal methods
The future of DSLs - functions and formal methodsMarkus Voelter
 
Introduction to Python Values, Variables Data Types Chapter 2
Introduction to Python  Values, Variables Data Types Chapter 2Introduction to Python  Values, Variables Data Types Chapter 2
Introduction to Python Values, Variables Data Types Chapter 2Raza Ul Mustafa
 
What is the deal with Elixir?
What is the deal with Elixir?What is the deal with Elixir?
What is the deal with Elixir?George Coffey
 
Erlang kickstart
Erlang kickstartErlang kickstart
Erlang kickstartRyan Brown
 
Lambdas, Collections Framework, Stream API
Lambdas, Collections Framework, Stream APILambdas, Collections Framework, Stream API
Lambdas, Collections Framework, Stream APIPrabu U
 

Similaire à Expression language in mule (20)

Mule expression language - Part 1
Mule expression language - Part 1Mule expression language - Part 1
Mule expression language - Part 1
 
Introduction to Erlang
Introduction to ErlangIntroduction to Erlang
Introduction to Erlang
 
3.pdf
3.pdf3.pdf
3.pdf
 
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
 
Lecture 09.pptx
Lecture 09.pptxLecture 09.pptx
Lecture 09.pptx
 
java_lect_03-2.ppt
java_lect_03-2.pptjava_lect_03-2.ppt
java_lect_03-2.ppt
 
Session 05 – mel and expression
Session 05 – mel and expressionSession 05 – mel and expression
Session 05 – mel and expression
 
Handout # 4 functions + scopes
Handout # 4   functions + scopes Handout # 4   functions + scopes
Handout # 4 functions + scopes
 
Scala Language Intro - Inspired by the Love Game
Scala Language Intro - Inspired by the Love GameScala Language Intro - Inspired by the Love Game
Scala Language Intro - Inspired by the Love Game
 
Scala tutorial
Scala tutorialScala tutorial
Scala tutorial
 
Scala tutorial
Scala tutorialScala tutorial
Scala tutorial
 
Is there a perfect data-parallel programming language? (Experiments with More...
Is there a perfect data-parallel programming language? (Experiments with More...Is there a perfect data-parallel programming language? (Experiments with More...
Is there a perfect data-parallel programming language? (Experiments with More...
 
The future of DSLs - functions and formal methods
The future of DSLs - functions and formal methodsThe future of DSLs - functions and formal methods
The future of DSLs - functions and formal methods
 
Introduction to Python Values, Variables Data Types Chapter 2
Introduction to Python  Values, Variables Data Types Chapter 2Introduction to Python  Values, Variables Data Types Chapter 2
Introduction to Python Values, Variables Data Types Chapter 2
 
Perl_Part4
Perl_Part4Perl_Part4
Perl_Part4
 
What is the deal with Elixir?
What is the deal with Elixir?What is the deal with Elixir?
What is the deal with Elixir?
 
Perl_Part1
Perl_Part1Perl_Part1
Perl_Part1
 
Erlang kickstart
Erlang kickstartErlang kickstart
Erlang kickstart
 
Lambdas, Collections Framework, Stream API
Lambdas, Collections Framework, Stream APILambdas, Collections Framework, Stream API
Lambdas, Collections Framework, Stream API
 

Plus de Son Nguyen

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introductionSon Nguyen
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with muleSon Nguyen
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overviewSon Nguyen
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filterSon Nguyen
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in muleSon Nguyen
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weaveSon Nguyen
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler muleSon Nguyen
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-boundSon Nguyen
 
Batch job processing
Batch job processingBatch job processing
Batch job processingSon Nguyen
 
Using message enricher
Using message enricherUsing message enricher
Using message enricherSon Nguyen
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connectionSon Nguyen
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoftSon Nguyen
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectorsSon Nguyen
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introductionSon Nguyen
 
Runing batch job in mule
Runing batch job in muleRuning batch job in mule
Runing batch job in muleSon Nguyen
 
Mule integration with cloud hub
Mule integration with cloud hubMule integration with cloud hub
Mule integration with cloud hubSon Nguyen
 
Mule with workday connectors
Mule with workday connectorsMule with workday connectors
Mule with workday connectorsSon Nguyen
 
Idempotent filter with mule
Idempotent filter with muleIdempotent filter with mule
Idempotent filter with muleSon Nguyen
 
Mule enterprise service introduction
Mule enterprise service introductionMule enterprise service introduction
Mule enterprise service introductionSon Nguyen
 

Plus de Son Nguyen (20)

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introduction
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with mule
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filter
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weave
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-bound
 
Batch job processing
Batch job processingBatch job processing
Batch job processing
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connection
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoft
 
Jms queue
Jms queueJms queue
Jms queue
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introduction
 
Runing batch job in mule
Runing batch job in muleRuning batch job in mule
Runing batch job in mule
 
Mule integration with cloud hub
Mule integration with cloud hubMule integration with cloud hub
Mule integration with cloud hub
 
Mule with workday connectors
Mule with workday connectorsMule with workday connectors
Mule with workday connectors
 
Idempotent filter with mule
Idempotent filter with muleIdempotent filter with mule
Idempotent filter with mule
 
Mule enterprise service introduction
Mule enterprise service introductionMule enterprise service introduction
Mule enterprise service introduction
 

Dernier

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Dernier (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

Expression language in mule

  • 2. Mule Expression Language(MEL) - Introduction  Mule Expression Language (MEL) supports the work of message processors by providing a means of accessing, manipulating, and using information from the message and its environment.  In most cases, Mule expressions work within message processors to modify the way those processors do their main jobs (for example, routing, filtering). Following are the principal use cases:  Make a decision based on the contents, properties, or context of a message and its attachments. For example, a flow controller can route purchase orders for different types of products to different JMS queues.  Select a value from the contents, properties, or context of a message and its attachments. For example, a cloud connector might extract a specific piece of information from the current message to use as an argument.  Replace a token with an actual value. For example, a logger can extract information from the payload contents and place it into a logging message.  We can also use MEL to implement a program (script) for which we would otherwise use a programming language like Ruby, JavaScript, or Groovy. Scripts in those languages cannot access the message and its environment as conveniently as MEL can. In this case, MEL is the programming language for a custom message processor.
  • 3. Mule Expression Language - Syntax Mule Expression Language Syntax  MEL expression combines one or more operands with zero or more operators in a Java-like syntax and returns the resulting value.  At the heart of MEL are property expressions of the form contextObject.property. These provide easy access to properties of the Mule message and its environment. For example, the expression “message.payload” represents the payload property of the message context object. Its value is the message payload.  Java method invocations and assignments are the other common MEL expressions.  In most cases, a MEL expression stands alone as the value of a configuration property of a message processor. Mule evaluates the expression at runtime, and the message processor uses the result.  The syntax of a MEL program largely follows Java, but MEL implements dynamic typing by performing type coercion at runtime. Semicolons follow each statement except the last, whether the statements are on one line or separate lines. Return statements are usually unnecessary, because a MEL program returns the value of the last MEL statement executed.  MEL operators and basic operands are conventional and predictable (for example, 2 + 2 == 4 returns true). Property expressions provide convenient access to information from the message and its environment (for example, server.fileSeparator returns "/" if the application is running on a Linux server, and "" on a Windows server.). The remainder of this section summarizes the most important elements of MEL syntax.
  • 4. Mule Expression Language – Operand, Property MEL Operand  An operand can be a literal, a variable, or a MEL expression.  The MEL expressions that most commonly appear as operands are property expressions and method invocations. Property Expressions  The syntax of a property expression is “contextObject.property”. This can appear as an operand in most MEL expressions, including on the left side of an assignment if the property is writable from MEL. Method Invocations  Mule Expression Language uses standard Java method invocation.  We can provide a fully qualified class name or import a class and use the unqualified name. MEL automatically imports a number of Java classes.  Eg. message.payload.getName(). If payload is a Java object—for example, representing a person— this code invokes its getName method. The value of the expression is the value that getName returns—presumably a string representing the person’s name. MEL Operators  MEL operators follow standard Java syntax, but operands are always by value, not by reference. For example, "A" == 'A' evaluates to true, whereas the same expression evaluates to false in Java.
  • 5. Arithmetic Operators Mule Expression Language – Arithmetic Operators Symbol Definition Example/Value - Minus. The value is the value of the first operand minus the value of the second. 2 - 4 -2 % Modulo. The value is the remainder after dividing the value of the first operand by the value of the second. 9 % 4 1 / Over. The value is the value of the first operand divided by the value of the second. 2 / 4 0.5 + Plus. For numbers, the value is the sum of the values of the operands. For strings, the value is the string formed by concatenating the values of the operands. 2 + 4 6 'fu' + 'bar' The String "fubar" * Times. The value is the product of the values of the operands. 2 * 4 8
  • 6. Comparison Operators Mule Expression Language – Comparison Operators Symbol Definition Example/Value == Equal. True if and only if (iff) the values of the operands are equal. 'A' == 'A' true != Not equal. True iff the values of the operands are unequal. 'A' != 'B' true > Greater than. True iff the value on the left is greater than the value on the right. 7 > 5 true < Less than. True iff the value on the left is less than the value on the right 5 < 5 false >= Greater than or equal. True iff the value on the left is greater than or equal to the value on the right. 5 >= 7 false <= Less than or equal. True iff the value on the left is less than or equal to the value on the right. 5 <= 5 true contains Contains. True iff the string on the right is a substring of the string on the left. 'fubar' contains 'bar' true is, instance of Is an instance of. True iff the object on the left is an instance of the class on the right. 'fubar' is String true
  • 7. Comparison Operators - contd Logical Operators Mule Expression Language – Logical Operators Symbol Definition Example/Value strsim Degree of similarity. The value of the expression is a number between 0 and 1 representing the degree of similarity between the two string arguments. 'foo' strsim 'foo' 1.0 ‘foobar’ strsim ‘foo’ 0.5 soundslike Sounds like. True iff the two string arguments sound alike according to a Soundex comparison. 'Robert' soundslike 'Rupert' true Symbol Definition Example/Value and Logical AND. True iff both operands are true. (Don’t use &&) (a == b) and (c != d) true iff a =b and c ≠ d || Logical OR. True iff at least one operand is true. true ||anything Always true or Chained OR. Scans left to right and returns the value of the first non-empty item false or '' or ' ' or 'dog' The String "dog"
  • 8. Mule Expression Language – Assignment, Literals MEL Assignment  An assignment is a MEL expression consisting of an identifier representing a mutable object to the left of an equal sign and a MEL expression to the right of the equal sign. Eg: message.payload = 'fu‘ sets the payload of the current message to the string "fu".  MEL determines types dynamically, so declaring the type of a variable is optional. For example if, with no prior declarations, if we write number = 1; number == '1' MEL assigns the expression the value true.  We can cast values to specific types. For example if we write number = (String)1; number is String MEL returns the value true for this expression. MEL Literals  Literals in MEL can be strings, numbers, Boolean values, types, and nulls. Maps, Lists and Arrays data structures as literals as well. MEL Literals – Numeric Literals  Numeric literals are integers and floating point numbers, with the same ranges of values as the underlying Java system. MEL Literals – String Literals  String literals are sequences of characters enclosed in single quotes. We cannot use double quotes to express String literals as we can in Java, because MEL expressions appear within double quotes in configuration files.
  • 9. Mule Expression Language – Literals MEL Literals – Boolean Literals  Boolean literals are the values true and false. These are case sensitive. MEL Literals – Null Literals  A null literal takes the form null or nil. These are case sensitive. MEL Literals – Type Literals  Refer to any Java class by its fully qualified name or if it is one of the classes in the below classes, by its unqualified name. References use the same dot notation as in Java, except that we must use $ rather than a dot to refer to a nested class.  MEL automatically imports the following Java classes.  java.lang.*  java.io.*  java.net.*  java.util.*  java.math.BigDecimal  java.math.BigInteger  javax.activation.DataHandler  javax.activation.MimeType  java.util.regex.Pattern  org.mule.api.transformer.DataType  org.mule.transformer.types.DataTypeFactory MEL Key/Value Maps, Lists, and Arrays  Maps are important in Mule Expression Language because much of the context you can work with comes in the form of maps.
  • 10. Mule Expression Language – Maps, Lists and Arrays MEL Key/Value Maps, Lists, and Arrays  Mule Expression Language uses a convenient syntax for maps and other data structures. It begins with map literals, and there is also a convenient way to access items in maps. MEL provides a streamlined way to access map data. Rather than constructing a map with a new statement, and then using its put method to populate it, we can simply write the following: [key1 : value1, key2 : value2, . . .] and use this literal form wherever we would otherwise use a map by name, including as a method argument.  similar literal forms for lists ([item1, item2, . . .]) and arrays ({item1, item2, . . .}).  Arrays in Java must specify the type of their contents, but in MEL they are untyped. MEL supplies the correct type when we use them – either by determining it at compile time or coercing the array to the correct type at run time. Accessing Map Data  MEL provides a simpler way to access map items than java.util.Map provides. For example, Mule associates a map containing properties set by the inbound endpoint processor with each message. We can refer to this map as message.inboundProperties. To retrieve the inbound property with key name foo, write 'message.inboundProperties[foo]'. If that property can be set (never the case with inbound properties, but true of some properties in other maps), we can write message.outboundProperties[foo]=message.payload on the left side of an assignment. If we try to set a property that cannot be set,Mule indicates failure by throwing org.mvel2.PropertyAccessException.
  • 11. Mule Expression Language–Control Flow, Context Objects Control Flow  MEL provides a full range of Java control flow statements. The most useful for typical MEL expressions are conditional operands (often called ternary statements).  A conditional operand has the form condition ? true value : false value. For example, x = (name == 'Smith' ? 'Smith' : 'Unknown') sets the variable x to the string "Smith" if the value of name is "Smith" and to the string "Unknown" if the value of name is not "Smith". MEL Context Objects and Functions  Property expressions facilitate the use of properties of the Mule message and its environment as operands in MEL expressions. They take the form contextObject.property. Context objects provide logical groupings of the properties of the message and its environment.  Functions provide ways to extract information that doesn’t already exist as a single value that can be embodied in a property. MEL Context Objects  Context objects model the message and its environment. They make MEL Mule-centric, not just another expression language. Different context objects are  Server: properties of the hardware, operating system, user, and network interface.  Mule: properties of the Mule instance.  App: properties of the Mule application.  Message: properties of the Mule message - [DEFAULT]
  • 12. Mule Expression Language – Context Object - Server Server  This object provides read-only access to the properties of the hardware, operating system, user, and network interface listed in the table.  For example, the value of 'server.userName' is a string representing the name of the user. Name Description fileSeparator Character that separates components of a file path ( "/" on UNIX and "" on Windows) host Fully qualified domain name of the server ip The IP address of the server locale Default locale (of type java.util.Locale) of the JRE (can access server.locale.language and server.locale.country) javaVersion JRE version javaVendor JRE vendor name osName Operating system name osArch Operating system architecture osVersion Operating system version systemProperties Map of Java system properties timeZone Default TimeZone (java.util.TimeZone) of the JRE tmpDir Temporary directory for use by the JRE userName User name userHome User home directory userDir User working directory.For example, the value of 'server.userName' is a string representing the name of the user.
  • 13. Mule Expression Language – Context Object – Mule, App Mule  This object provides read-only access to the properties of the Mule instance listed in the table.  For example, the value of 'mule.version' is a string representing the Mule version. App  This object provides access to the properties of the Mule application listed in the table  For example, the value of 'app.name' is a string representing the application name.  For example, 'app.registry['foo']' refers to the object named foo in the Mule registry map. You can set or retrieve its value. Name Description clusterId Cluster ID home File system path to the home directory of the mule server installation nodeId Cluster node ID version Mule Version Name Description encoding Application default encoding (read-only) name Application name (read-only) standalone True if Mule is running standalone (read-only) workdir Application work directory (read-only) registry Map representing the Mule registry (read/write).For example, the value of 'app.name' is a string representing the application name.For example, 'app.registry['foo']' refers to the object named foo the Mule registry map. You can set or retrieve its value.
  • 14. Mule Expression Language – Context Object – Message Message  This object provides access to the properties of the Mule message listed in the table. Name Description id (read-only) rootId (read-only) correlationId (read-only) correlationSequence (read-only) correlationGroupSize (read-only) replyTo (read/write) dataType (read-only) payload (read/write) inboundProperties Map (read-only) inboundAttachments Map (read-only) outboundProperties Map (read/write) outboundAttachments Map (read/write) exception (read-only)
  • 15. Mule Expression Language – Variables Variables  In addition to local MEL variables, whose scope is the current message processor, MEL gives you access to Mule flow and session variables. The variables reside in the following maps, which are available to use in MEL expressions:  flowVars – contains variables that are global to the current flow. They retain their values as control passes from one message processor to another. Thus, you can set them in one message processor and use them in another.  SessionVars – is essentially the same as flowVars, except that when one flow calls another one via a Mule endpoint they are propagated.  For example, to access the value of the foo flow variable, write flowVars['foo']. This can appear on either side of an assignment. For example, the following code gets the value of the session variable bar and uses it to set the value of the flow variable bar. flowVars['foo'] = sessionVars['bar']  As a further shortcut, you can simply use foo as a variable name in a MEL expression. If there is no local MEL variable called foo, the MEL processor looks for one in flowVars, then in sessionVars, before failing. For example, if the MEL expression contains foo == 'cat' and there is no local MEL variable named foo, but there is a foo key in flowVars, then the foo in the expression is equivalent to flowVars['foo'].  Note, however, that we can turn this method of resolution off by including a configuration attribute in the xml configuration file: <configuration> <expression-language autoResolveVariables="false"> </configuration>
  • 16. Mule Expression Language – Data Extraction Function Data Extraction Function  The functions xpath and regex provide ways of extracting context information extract information that doesn’t already exist as a single value that can be embodied in a property. By default they work on the payload, but we can pass them different arguments explicitly.