Questions tagged [mule-el]

The Mule Expression Language (MEL) is the primary language used for formulating such expressions throughout Mule ESB.

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. All features of MEL can be used in XML application configuration files, and a few require additional Java programming. All MEL features are available within the visual interface provided by Mule Studio.

A typical 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.).

392 questions
0
votes
1 answer

Mule: sending an input stream payload (from file) along with file metadata to http outbound endpoint

I have an input stream payload with data from a file. The file can be very big. I'm sending the input stream to an http/https outbound endpoint. However, I'd like to also send metadata with the contents of the file, such as the file name and…
Loic Duros
  • 5,472
  • 10
  • 43
  • 56
0
votes
1 answer

Mule check inbound http request is GET

I have an HTTP inbound endpoint which receives both GET and POST request. I notice one of the INBOUND scope properties is: http.method=GET Right after the http inbound endpoint, I have a choice, and I'd like to check if the message sent is GET or…
Loic Duros
  • 5,472
  • 10
  • 43
  • 56
0
votes
2 answers

Global Catch Exception Strategy is not used

I have defined a global exception strategy, but when Mule executes my Groovy script it does not execute the Global Catch Exception Strategy, but rather executes the org.mule.exception.DefaultSystemExceptionStrategy.