

Non-MEL Expressions Configuration Reference

The Mule Expression Language (MEL) removes the need to use old expressions in Mule. Refer to Mule Expression Language MEL for details on how to use MEL. This page provides reference information for configuring pre-Mule 3.3 style expressions.

Expression Attributes

The XML configuration elements in Mule that support expressions have three common attributes that define the expression to execute, the evaluator to use, and the option of defining a custom evaluator.

Attribute Description


The expression to evaluate. The syntax of this attribute will change depending on the evaluator being used.


The expression evaluator to use. Expression evaluators must be registered with the following before they can be used:

Using the custom evaluator allows you to define your custom evaluator via the custom-evaluator attribute. Note that some evaluators such as Xpath, Groovy, and Bean are loaded from other Mule modules (XML and Scripting, respectively). These modules must be on your classpath before their evaluators can be used.


The name of a custom evaluator to use. This evaluator must be registered in the local registry before it can be used.

Expressions can be used in a number of other scenarios such as filters, routing, and endpoints.

Expression Syntax

There are two ways of specifying expressions depending on where the expression is being used. Typically, expression-based elements such as the expression transformer, expression filter, and expression-based routers such as the expression message splitter, will have specific attributes for expression, evaluator, and custom-evaluator. For example:

<expression-filter evaluator="header" expression="my-header!=null"/>

For these elements, you can set only a single expression for the element. When defining expressions for things like property values, you can set multiple expressions using the following syntax:


The syntax requires that you precede an expression with #[, and then define the evaluator followed by a colon (:) and the expression to execute. Finally, you terminate the expression with a ]. You can define multiple expressions as a string. For example:

    <add-message-property name="GUID" value="#[string:#[xpath:/msg/header/ID]-#[xpath:/msg/body/@ref]]"/>

For a list of available evaluators, see Expression Evaluator Reference below.

Optional Values

As of Mule 2.2, you can use an asterisk to indicate an optional property in the expression. For example the following expression would indicate that foo and car must be present, but bar is optional:


Spring Property Placeholders and Expressions

Spring and Mule have had long-time support for property placeholders that allow developers to inject static properties into their configuration when their application starts up. The property values are defined in Java property files that are passed into the framework on start up. The following example shows a properties file that defines configuration information used by a Mule endpoint:


The Mule configuration file can embed these properties as placeholders.

<mule ...>
    <http:endpoint name="request-config" host="${}"

These property placeholders are resolved during the start-up phase of your application. Mule expressions are evaluated continuously for every message received or sent.

Expression Evaluator Reference

Following are the default expression evaluators that are loaded at runtime. Not all expression evaluators are supported by every type of expression-based object. For example, the attachment evaluator is available to routers but not filters.

Name Example Comments



Not supported by expression filters.



Returns a java.util.Map of attachments. Not supported by expression filters.



Returns a java.util.List of attachments objects. Not supported by expression filters. You can specify * to retrieve all attachments or a wildcard pattern to select attachments by name.



The bean property expression. Use "." or "/" as element delimiter.



Use Not supported by expression filters.



Matches an exception type. Only supported by expression filters.



Performs a function: now, date, datestamp, systime, uuid, hostname, ip, or count. Not supported by expression filters.



Evaluates the expression using the Groovy language.



Evaluates the specified part of the message header.



Returns a java.util.Map of headers. Not supported by expression filters. You can specify #[headers:*] to get all headers.



Returns a java.util.List of header values. Not supported by expression filters.



For expression syntax, see:



As of Mule 3.1, returns the node object from the json expression as is. For expression syntax, see:



JXPath expression that works on both XML/DOM and Beans.



Returns a value from within a java.util.Map payload. Not supported by expression filters.



Available expressions are id, correlationId, correlationSequence, correlationGroupSize, replyTo, payload, encoding, and exception. Not supported by expression filters.



Set the evaluator attribute on the <expression-filter> element to ognl when specifying an OGNL filter. Note: OGNL is deprecated in Mule 3.6 and will be removed in Mule 4.0.



If expression is provided, it’s a class to be class loaded. The class is the desired return type of the payload. See `getPayload(Class)`in:

Not supported by expression filters.



Matches the type of the payload. Only supported by expression filters.



As of Mule 3.1.0, invokes a message processor within an expression. This processor can be any component, transformer, custom processor, processor chain or flow. This evaluator is most useful when used with a nested expression that determines the value that will be processed by the referenced message processor.


#[regex:the quick brown (.*)]

Only supported by expression filters.


#[string:Value is #[xpath://foo] other value is #[header:foo].]

Evaluates the expressions in the string.



Used for retrieving values of flow variables.



Only supported by expression filters.



The expression is an XPath expression.



As of Mule 2.2, returns the node object from the XPath expression as is.

Expression Enricher Reference

As of Mule 3.1.0, the following are the default expression enrichers that are loaded at runtime.

Name Example Comments



Used for storing variable values in a flow.



Adds/overwrites the specified message header.