Описание тега mule-el
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.).