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
1
vote
2 answers

How to embed CDATA in Mulesoft

I'm trying to embed a literal CDATA value in a Mulesoft flow and cannot figure out how to do so. My desired output (in an HTTP request body) is:
Steve N
  • 2,667
  • 3
  • 30
  • 37
1
vote
5 answers

How to find current flow name in mule?

I need to capture current flow name into a variable. I tried with #[flow.name] but no luck in mule 3.8.0 can anybody please assist me?
Thiru
  • 404
  • 1
  • 16
  • 44
1
vote
1 answer

How to get list of flows in app using mule expression language or java

I have to print the list of flows in the present application. Please help me out.
Hrishabh
  • 21
  • 4
1
vote
1 answer

Http Response Builder Deprecated in 3.6 Mule? But able to see inside HTTP Listener Component

I have a small query to be clarified Regarding HTTP Response builder. I can able to see response builder inside HTTP listener in 3.6 ,3.7 and also 3.8. But the url says https://docs.mulesoft.com/mule-user-guide/v/3.7/http-response-builder Response…
star
  • 1,493
  • 1
  • 28
  • 61
1
vote
3 answers

Java Component in Mule does not use project's UTF-8 encoding

I have a java component in Mule that is returning a String. When I print that string from within the java component, it reads as UTF-8 just fine in the console. However, when I return this as the payload, the subsequent logger and all downstream…
Gary Sharpe
  • 2,369
  • 8
  • 30
  • 51
1
vote
1 answer

Migrating Mule 3.6 to Mule 3.7 NullPointerException calling method with null payload

I'm migrating my mule project from version 3.6 to 3.7. In version 3.6 I was able to use invoker calling a method passing payload as an argument. Now in version 3.7 if I do that I get NullPointerException, when payload is null, in class…
Sérgio Abreu
  • 177
  • 2
  • 15
1
vote
1 answer

Migrating Mule 3.6 to Mule 3.7 Nullpayload test

I'm migrating my mule project from version 3.6 to 3.7. In version 3.6 the test #[NullPayload.getInstance().equals(payload)] return true when my payload is null, however in version 3.7 when the payload is null this tests return false. I saw in the…
Sérgio Abreu
  • 177
  • 2
  • 15
1
vote
0 answers

How to access previous iteration element in mule dataweave

I want to access previous value element BaseChargePerUnit in the next iteration. The NewPrice value must be same in the next iteration as previous iteration's PreviousPrices value %dw 1.0 %input payload application/xml %output application/xml …
Rohan Shinde
  • 131
  • 1
  • 4
  • 21
1
vote
3 answers

How to encrypt a single element if a JSON response in Mule?

I have a JSON message say {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }} I…
Naveen Raj
  • 801
  • 11
  • 26
1
vote
1 answer

How to use equal Ignore Cases in Dataweave

I want to check equal Ignore cases in dataweave %dw 1.0 %output application/xml --- Order: { Channel:payload.Order.@EnterpriseCode, Code:payload.Order.@OrderNo, (Status:payload.Order.@Status) when…
Rohan Shinde
  • 131
  • 1
  • 4
  • 21
1
vote
1 answer

Nested While looping in mule Dataweave

How to write nested while looping in mule dataweave I have code like this, (UnitMeasureVal:"EACH") when ($.@attribute-id) == "UnitMeasure" and ($ is :empty or ($ =="N/A" or $ =="NA")) otherwise (UnitMeasureVal: $), But its giving error, I am not…
Rohan Shinde
  • 131
  • 1
  • 4
  • 21
1
vote
2 answers

Using mulerequester when there are more than one jms or wmq connector

This is continuation from How to use Mule Expression in JMS:selector but a different question. I am using mulerequester to read off the queue as shown below.
Joe
  • 111
  • 1
  • 10
1
vote
1 answer

Length Validation in Dataweave

How to do length validation in Mule Dataweave %dw 1.0 %output application/xml --- (payload default []) map { Field1:$.Field11, Field2:$.Field22, Field3:$.Field33, Field4:$.Field44 } I want to do validation like max Length of Field22…
Rohan Shinde
  • 131
  • 1
  • 4
  • 21
1
vote
2 answers

How to use Mule Expression in JMS:selector

I checked several previous discussions but couldnt find the answer. I am trying to achieve synchronous communicaiton using JMS back-channel (http://www.whishworks.com/blog/synchronous-communication-using-jms-back-channel). Apart from the things…
Joe
  • 111
  • 1
  • 10
1
vote
2 answers

Handle NULL xml nodes in Dataweave

How can I access the body and/or avoid error of NULL values in xml nodes in mule data weave. Consider this is my node: 5014414203648
Rohan Shinde
  • 131
  • 1
  • 4
  • 21