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
7
votes
8 answers

How to ignore empty objects in DataWeave Mule esb

I am working on transforming my payload. I have got the situation here. Input payload looks like this below one:- { "address": { "city": "bab", "company_name": "asdast", "country_code": "sam", "location": { "city": null, …
Infinity
  • 484
  • 2
  • 8
  • 21
6
votes
5 answers

Mule: getting a hold of the exception message

I have a default catch exception in Mule, and I'm trying to get access to the exception message, using a Mule expression: #[exception] This doesn't seem to work, and I'm guessing that I'm trying to access the wrong variable? I'm trying to log it…
Loic Duros
  • 5,472
  • 10
  • 43
  • 56
5
votes
3 answers

Array to flat mapping in Mule based on condition

I am attempting to map a response from a 3rd party call into a different structure using the DataMapper transform within Mule. From the 3rd party we receive an array of items (amongst other things) and I want to map a single item within the array to…
user2294382
  • 871
  • 3
  • 11
  • 25
5
votes
2 answers

How to Check null condition in Data weaver : Mule

Here is my xml, in that first I need to check 'RecordsEntries' should not be 'null', then RecordEntry shouldn't be null followed by mapping code false
star
  • 1,493
  • 1
  • 28
  • 61
4
votes
4 answers

Dataweave Error for Null nodes

I have done coding in dataweava as %dw 1.0 %input payload application/xml %output application/xml skipNullOn="everywhere" --- {((payload.*Order default []) map { Order:{ Channel:$.@EnterpriseCode, Code:$.@OrderNo, Status:$.@Status, …
Rohan Shinde
  • 131
  • 1
  • 4
  • 21
4
votes
6 answers

How to read parameter in mule esb

I am sending some parameter to mule which is listening through http inbound in 8081 I am sending. http://localhost:8081/hey?age=manoj But I don't know How can I take this as from message?? I know I can access it from message and payload but when I…
Manoj Singh
  • 1,329
  • 2
  • 13
  • 24
4
votes
4 answers

Mule MEL to do substring on a flow variable

I have a variable my_variable with value as a dynamic URL like -- http://stackoverflow.com/questions/ask I want to do a substring on this dynamic URL to find the string after last "/" i.e. in case above mentioned URL, I want to get the substring…
user1493140
  • 5,976
  • 4
  • 29
  • 49
4
votes
2 answers

Mule Flow Variable vs Session Variable Performance

Besides the functionality differences between flow variable and session variable as described in Mulesoft page, are there any significant performances differences to note while using the two? For my project, using flow and session variables work…
Jek
  • 5,546
  • 9
  • 37
  • 67
4
votes
2 answers

MEL logical AND acting weird, order of operands matters?

Can anyone explain why the following behavior occurs? Why does the order of the operands matter when using logical AND? Running on mule-ce 3.3.1. The output is as follows: true true false true
Zavior
  • 6,412
  • 2
  • 29
  • 38
3
votes
1 answer

xml elements with same attribute names getting overriden

My XML Structure looks like below:- Roll jayz eminem drake After transformation I am…
leo_roar_001
  • 181
  • 1
  • 10
3
votes
4 answers

Correct payload transformation - Error sending HTTP request. Message payload is of type: byte[]

I'm getting: Error sending HTTP request. Message payload is of type: byte[] when sending HTTP request. Situation is like on picture: I pass url query parameters parameters and they are saved in variables, then I use map transformer to build xml…
user1598696
  • 550
  • 1
  • 4
  • 22
3
votes
3 answers

pass parameters to SOAP request in mule esb

I have situation like on picture: I configured request connector like i did in soap-ui, but I don't know how to build valid SOAP HTTP_Request with uri or query parameters from HTTP listener. How can I pass those parameters to SOAP…
user1598696
  • 550
  • 1
  • 4
  • 22
3
votes
1 answer

How to invoke Java Mule component with enum value as method parameter?

I am working currently on an API that is exposed by Mule ESB 3.5.0 (non-EE). This API accepts a XML file with accounts to be imported via HTTP and puts this task definition into a RabbitMQ queue. Another Mule flow is responsible for taking items…
Maciej Papież
  • 431
  • 1
  • 6
  • 20
3
votes
6 answers

How to read an XML file in Mule Anypoint Studio after invoking an HTTP endpoint?

I am new to Anypoint Studio and I am trying to create a flow that will have an HTTP connector and an endpoint and when a user invokes the http endpoint then the application will load the contents of an XML file, will convert then to JSON and will…
NikosDim
  • 1,398
  • 2
  • 21
  • 40
3
votes
3 answers

Mule Web Service Consumer Warning : Operation Messages With More then 1 Part Are Not Supported

Hi I am working with Mule Web Service Consumer and i was trying to call operation with Multiple Parameters it is warning me that Warning : Operation Messages With More then 1 Part Are Not Supported I just want to pass multiple parameters to access…
Utsav
  • 1,593
  • 4
  • 22
  • 46
1
2 3
26 27