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
1 answer

How do you read Cookies from the response of an HTTP Outbound Endpoint in Mule?

The documentation makes posting cookies rather clear, but it does not provide an example of how to read cookies from an incoming response on an outbound http endpoint in…
Gary Sharpe
  • 2,369
  • 8
  • 30
  • 51
1
vote
2 answers

Mule expression language to read a properties dynamically from property file

I have a Mule flow in which there is a session variable "servicerequested" and this variable can have different values like - customerservice,accountservice,transferservice,etc. There is a property file mule.dev.properties which has information of…
user2254601
  • 164
  • 2
  • 8
0
votes
1 answer

Mule 3 in Debug Mode - how do I view payload as JSON?

So this question is specific while running Anypoint Studio 6.x ( 6.6.10 ) in debug mode ( Mule 3 ) Now as a part of the implementation many a times the payload or variables are stored in format application/java which while debugging makes it…
boomslaw
  • 31
  • 4
0
votes
1 answer

Need to know how can we use below expression component in Mule 4 using DataWeave or any other method

I am working on code migration and in that I am facing problem in migrating expression component of Mule 3 to Mule 4. I tried it using Transform Message Component but I am facing some errors in it. Can someone Please help me to migrate the below…
0
votes
1 answer

How to remove %20 (URI encoded space) after split function in Mule 3

I'm using a split function to create an array from the results, so I can use the foreach loop. The foreach loop contain HTTP request connector that takes the array as payload and loops over the different ids. The problem is when the array enters the…
Makavelines
  • 111
  • 6
0
votes
1 answer

How to retrieve datetime minus 4 hours in Mule 3

I'm trying to get the current time minus 4 hours using the dateTime function. With the next expression: #[server.dateTime.plusHours(-4)format("yyyy-MM-dd'T'HH:mm:ss'Z'")] Flow:
Makavelines
  • 111
  • 6
0
votes
2 answers

How to iterate over the fault message in Mule 4

In my case, I tried to convert the below Mule Expression Language (MEL) script to DataWeave 2.0. MEL script on Mule 3: import java.util.Iterator; import org.dom4j.*; import java.util.logging.Logger; import java.util.*; faultstring =…
codey_08
  • 249
  • 1
  • 11
0
votes
1 answer

Getting error "unbalanced braces" in data weave in mule 3.9.3

I am using choice router to evalute expression. Here is the expression and I tested this expression in dataweave here is the result. but when I use the choice router to evalute the expression I am getting this result and another thing the value…
kushma gonna
  • 236
  • 3
  • 19
0
votes
1 answer

MEL to DataWeave conversion

We are migrating Mule 3 app to Mule 4 where we have encountered below MEL. Any inputs on how to convert it to DataWeave. mel:prevProperties.get(payload.get("A1 - Roll Number")) == null ? prevProperties.put(payload.get("A1 - Roll Number"),…
0
votes
1 answer

Is there any function or dependency that can convert the month in a date to desired language in dataweave1 (mule3)?

I am working on a problem where date must be converted to the desired format. And if the format is yyyy/MMM/dd then the month should be converted to the language which is fetched from db. eg. For 2021-01-12 the desired format is yyyy/MMM/dd and…
Srvastav4
  • 177
  • 2
  • 12
0
votes
1 answer

How to differentiate error from 2 until-successful component in a single mule flow?

I am using mule version 3.9. I am having a mule flow in which i am making 2 http calls to different URLs. First one is a retrieve call and then do some transformation and then i am calling the update api. I have put both API calls in individual…
Arun Raja
  • 27
  • 1
  • 8
0
votes
1 answer

Mule 3 retrieving the placeholder value dynamically

I have a use-case that I need to retrieve the value from my properties file but that key should be derived dynamically from my query params. How to handle this in MEL or Groovy? I am aware it is possible in DW. Http…
NGBeginner
  • 403
  • 1
  • 3
  • 14
0
votes
1 answer

I am trying to decode a Base64 format Token after retrieving it from Object store in Anypoint Studio. Help resolve the dataweave error?

I am trying to decode a BASE 64 format token after getting it from object store but getting error in transform message. Output after Object Store Retrieval. This needs to be…
0
votes
0 answers

How to write CSV over and over within For-each loop in Mule 3?

Im trying to write CSV within For-each loop in Mule 3. Reading CSV file Passing parameter to the API to get response if no response, will write into another csv file. To maintain parameter value i set record variable before API calling and no…
user2848031
  • 187
  • 12
  • 36
  • 69
0
votes
1 answer

"Store WSDL file into a folder"

I have a flow where I am getting the WSDL defination by using CXF and java component. http://localhost:8081/soapapi?wsdl Here I am getting the WSDL defination but I am not able to store that output into a file.
Devendra
  • 219
  • 2
  • 22