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

my expression fails with a runtime exception

I'm attempting to bring back one of the element values from an IDOC, to determine a variable value. When I run this in the debugger just to test it brings back the right value, but when i run it as part of the expression it fails - import…
Dorbs
  • 173
  • 3
  • 15
0
votes
1 answer

"Merge two payload into one in transform component "

I am trying to add two json payload into one but getting error. I am using scatter gather where I am getting multiple payload and combining the payload into transform message. Error is: Exception while executing: payload[0] map (bookListing) ->…
Devendra
  • 219
  • 2
  • 22
0
votes
1 answer

How to read file in middle of the flow

I am trying to read two simultaneously file in middle of the flow and combine them into one payload. To reading the files in middle of the flow I am using mule requester component. While triggering the flow (localhost:8081/requester/requester)I am…
Devendra
  • 219
  • 2
  • 22
0
votes
1 answer

"Read multiple file from different location simultaneously and merge them into one payload"

I am reading the multiple files from different folder and merging them into one but not able to merge into one file. I am using composite source where I added two file connector then I am logging the payload into logger. payload I am getting one by…
Devendra
  • 219
  • 2
  • 22
0
votes
1 answer

Exception Handling in Mule 4

I have to define a global exception handler and for each flow I have to define the same set of exceptions I want to use global exception handling in Mule 4 , I am following below steps , please suggest/help to configure exception handling globally…
Developer
  • 21
  • 1
  • 7
0
votes
1 answer

Conversion of data to json

Please find enclosed 3 screenshots in one of above usecase in debug mode , I am trying to obtain the result in json format but I am getting the result as mentioned in lower screenshot in postman . Please help . Thanks
Developer
  • 21
  • 1
  • 7
0
votes
1 answer

How to hit an API parallely with different input paramters

I am getting doctorCodes as (Dr1124914 ,Dr1074955). My clinic API gives above response taking one doctorCode a time ,I have to extract a value from my response. But I want to make parallel calls to my API with all values of doctorCodes as…
Developer
  • 21
  • 1
  • 7
0
votes
2 answers

Replacing Null with Blank blank in Dataweave 2.0

I have to replace null with blanks in dataweave 2.0 , I tried many combinations but getting error in it . The screenshot is attached for your reference . Please provide any pointers for the same . Thanks.
Developer
  • 21
  • 1
  • 7
0
votes
1 answer

Regarding Addition of elements of payload through dataweave 2.0

I am adding the elements of a payload in Dataweave 1.0 as below : %var summation =[[]] summation :sum ((schemaInput map ($.BenefitLimit when $.BenefitLimit !="" otherwise (0 as :number)))) , Can anyone help me to replicate the same logic in…
Sourabh
  • 1
  • 1
0
votes
1 answer

Mule4 time format

I am facing issue while doing string to time conversion in DataWeave2.0. I am having string as "1800", my requirement is to convert it into time in HH:MM:SS format. I tried going through Mule docs on DateTime, Time but not able to convert string to…
Maddy
  • 11
  • 1
  • 6
0
votes
1 answer

Add BOM in the beginning of a String

I have exposed a GET in an API which returns an application/csv back to the caller. NB: the resulting application/csv is just a string. The caller wants the result to include a BOM. This is how I set the contents of the returned application/csv…
Stanislav Ivanov
  • 425
  • 2
  • 7
  • 19
0
votes
2 answers

Facing issue while mocking the database count query response in mock activity using mule

I have the db connector in mule, which has the select query to count the number of records and the response from the database is as below: MULE CODE SNIPPET:
user3368821
  • 79
  • 2
  • 9
0
votes
1 answer

How to have a delete flow in Mule Application?

I just came to know about this Mule ESB and started playing with it. I checked few youtube videos and trying a basic flow which will just 1. delete a file or folder, 2. copy a file from source to destination, 3. move a file from source to…
Saravana Kumar M
  • 460
  • 9
  • 19
0
votes
0 answers

salesforce connector in Mule - SOQL long query is not working properly for some objects - like product2

I am facing an issue while running product2 SOQL long query in Mule salesforce Connector. I am able to run and got successful json message with certain fields like Id, Name, ProductCode, Description etc . But some other fields are not working…
0
votes
1 answer

custom File filter for sftp connector in mule

I am trying to use sftp inbound connetor of mule. but I need to read only the file with specific naming convention having date(ddMMyyyy) in the middle. fileName format : _.zip example : test1_001_10072018_data.zip, test2_011_10072018_data.zip I…
udit khare
  • 354
  • 2
  • 10