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
3
votes
2 answers

How do I pass a parameter to a Java Component from a Mule flow?

I'm just getting started with mule and cant figure out how I can possibly pass a part of my request header as a parameter/argument to the Java component. My Java Component is as follows public String processHeader(String in) { //process header …
userNotFound
  • 347
  • 1
  • 4
  • 13
3
votes
1 answer

How do I handle an HTTP path parameter in mule Choice router?

I am trying to use a choice router to handle HTTP messages based on their path. This works well until I hit the case where the message is being submitted with a PUT method and the trailing part of the path is the customerID. So I have a path similar…
SteveS
  • 1,008
  • 3
  • 18
  • 32
3
votes
1 answer

How to validate content type=JSON in Mule

I have a Mule config in which there is 2 flows :- One flow expose a REST Service :-
Anirban Sen Chowdhary
  • 8,233
  • 6
  • 39
  • 81
3
votes
1 answer

Mule Message Property after splitting shows all properties values for splitted message in one field

We are trying a scenario where we send a list of requests in one payload, split that payload to individual requests based on some xpath, make individual http outbound calls and aggregate them on the back. Entire process works fine but we tried…
Rama Kesara
  • 94
  • 1
  • 7
3
votes
1 answer

Setting Map as payload in Mule Flow using MEL

I am trying to generate and set a map (with 2 key value pairs) on the fly as the payload for the following HTTP call. However, the MEL expression for creating the Map is not working.
user1493140
  • 5,976
  • 4
  • 29
  • 49
3
votes
7 answers

What is the difference between MULE Studio and MULE ESB?

I am new in mule soft. i dont know what is the difference between mule studio and mule esb. both software are looking same only. mule studio is graphical representation as well as we can generate by code also. how can i differentiate both. what is…
user3129532
  • 69
  • 3
  • 9
3
votes
3 answers

Mulesoft - Using choice component

I'm developing an application with mule studio, I need to use the "Choice" component, but I'd like to evaluate not a message property contained in the payload, but a variable contained in a property file, like that:
user1820620
  • 672
  • 2
  • 13
  • 27
3
votes
2 answers

How to add new tag in xml structure payload using MEL (mule)

I'm new to Mule, please guide me how to insert new tag inside the XML structure using Mule Expression Language (MEL).Need to insert B tag in the below XML structure table 1 table 3 Thanks in Advance.
star
  • 1,493
  • 1
  • 28
  • 61
3
votes
1 answer

How to use a property variable inside a mule MEL expression?

I'm loading in various values via a property file using context:property-placeholder. I can use the properties for Spring injection and logging without error, but i'm receiving an exception when I try to evaluate them within a MEL…
TERACytE
  • 7,553
  • 13
  • 75
  • 111
2
votes
1 answer

concatenate file name and time for the file Name/pattern Mule 3

I'm trying to concatenate the filename and dateTime inside the file connector as name for the output file. I get a syntax error. This because MEL expressions already appear enclosed in double quotes in configuration files, so I have to escape the…
Makavelines
  • 111
  • 6
2
votes
2 answers

Custom Json Validation in anypoint studio

I am trying to validate JSon using the json schema validator. But it returns a generic message. "Json content is not compliant with schema" . I have a HTTP POST REQUEST which sends a payload as follows: { "key1" : "value1", "key2" : "value2"…
HMT
  • 2,093
  • 1
  • 19
  • 51
2
votes
1 answer

Mule API AutoDiscovery vs Mule API GatewayProxy

When should we use API Proxy against API AutoDiscovery. After implementing both, I found AutoDiscovery can also apply policies, analytics which API Gateway does, only thing is I cannot use a different url if using AutoDiscovery. Main advantage of…
2
votes
1 answer

Can Mule Expression Language (MEL) be used outside of the MuleESB?

I need to use an expression language and there are many to choose from. MEL has stood out as very easy to understand and powerful. However, Mule Expression Language is in the mule core library in maven. Can MEL work as a standalone expression…
Jason
  • 2,006
  • 3
  • 21
  • 36
2
votes
3 answers

How to access the invocation property?

I am trying to access the _clienName from the invocation properties. I tried the below one, but doesnt help. any thoughts ? Is it really possible to access invocation property in a mule flow ? #[message.invocationProperties['_clientName']] Message…
gnanagurus
  • 883
  • 1
  • 12
  • 29
2
votes
3 answers

How to read particular one file in mule using MEL?

These all files downloaded from ftp. I have tried this flow :
1
2
3
26 27