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

Mule Dynamic HTTP outbound address

I am trying to dynamically set the HTTP outbound address using the following code --
user1493140
  • 5,976
  • 4
  • 29
  • 49
1
vote
3 answers

Using mule expression to point to elements in JsonData Object

I have an inbound payload in JSON format. I'm converting it using the "JSON to Object" converter, and then passing on the data to a component (as a JsonData object.) My component then returns the same JsonData object with modifications. I'm trying…
Loic Duros
  • 5,472
  • 10
  • 43
  • 56
1
vote
1 answer

Mule ESB: File outputpattern doesn't translate the pattern

I'm using Mule ESB CE 3.4. I have a requirement where I'm reading the configuration information from database and using it as the file name for the file outbound endpoint. Here is an example code (the code may not work as I have only given an…
Tech Matrix
  • 283
  • 2
  • 7
  • 13
1
vote
2 answers

Mule - split a big JSON list into multiple smaller JSON lists

I have a list of json objects containing about 200 objects. I want to split that list into smaller lists where each list contains max 20 objects each. I would like to POST each sublist to HTTP based endpoint.
user1493140
  • 5,976
  • 4
  • 29
  • 49
1
vote
1 answer

Mule Message Enricher Target Expression

I have a flow that takes a pair of dates inbound and then uses a message enricher to get a list of employees that worked on a specific job between those two dates. The result is a simple list of maps returned from a JDBC database. I got that saved…
Brad Overstreet
  • 75
  • 1
  • 1
  • 7
1
vote
1 answer

Creating comma separated strings from a list in Mule ESB

I'm extracting emails from JSON formatted data using MVEL in a enricher which returns me as a list. I want to create comma separated string with these emails so I can pass it to JDBC. I tried the following,
Tech Matrix
  • 283
  • 2
  • 7
  • 13
1
vote
1 answer

Losing original exception message in rollback exception strategy on-redelivery-attempts-exceeded

I have a rollback exception strategy in place which looks for a message queue full scenario. The issue I am facing is when the maxRedeliveryAttempts="3" is exhausted, on-redelivery-attempts-exceeded code is executed but inside the…
1
vote
2 answers

how to use value of #[server.dateTime.weekOfYear] in mule-app.properties or configuration xml

I am downloading files from FTP. I am able to download files with defined patterns or defined name and pass then process these files in Java. Problem I am facing is that I need to download a new file every week. The file name is like…
Rizwan Sohaib
  • 1,240
  • 17
  • 27
1
vote
2 answers

Mule - Set properties on spring object call in Mule flow

I'm using Mule 3.3.CE I have a Class called SpringObject which implements Callable interface package com.threads.test; import org.mule.api.MuleEventContext; import org.mule.api.lifecycle.Callable; public class SpringObject implements Callable { …
UserMan
  • 471
  • 2
  • 10
  • 20
1
vote
2 answers

Mule 3.4 -JUnit TestCase failing over DataMapper MessageProcessor in Mule ESB

kindly help me to overcome this issue. I have developed my mule flow ( version 3.4). When i run the JUnit Test case, Flow running fine till the Data Mapper message processor. Once after reaching dataMapper flow throwing the error like .grf doesnot…
star
  • 1,493
  • 1
  • 28
  • 61
1
vote
3 answers

how to retrieve Schema Validation error result in mule-esb

In Mule, am trying to validate a XML against XSD. In my flow am using schema-validation-filter component nested with in message-filter component and working as expected. but my question is, if XML fails, how do I capture the error details in logger…
user2944686
  • 13
  • 1
  • 5
1
vote
1 answer

How to handle HTTP session in mule?

I have some rest services in mule , I need to authenticate before each call. for that one I'm planning to make a login service first and session checking for later requests. is the right approach or please advice How to handle HTTP session in mule?
Jamsheer
  • 3,673
  • 3
  • 29
  • 57
1
vote
0 answers

Mule ESB does not able to pass a message property as input in Oracle Store Procedure

Good morning everybody, I have a question for you about the mule's behviour when it has to execute a Oracle Store Procedure in MuleEE 3.4. In my application I should invoke a Store Procedure in a Oracle Database and I should pass it an input…
Paride Letizia
  • 330
  • 1
  • 4
  • 23
1
vote
1 answer

Mule MEL to read database result-set from an second 'database outbound endpoint'

I have a flow something like this A 'Database inbound endpoint' which polls(for every 5 mins) to mySQL Database-Server and get result-set by a select-query (automatically this becomes the current payload i.e #[message.payload]) 'For each' component…
Learner2207
  • 117
  • 2
  • 13
1
vote
2 answers

How to throw exception manually in Mule ESB without using java code

I'm new to mule, please help me on this logic. Actually in my flow i have choice message processor, Expression which is not satisfy it will go to default in choice. After that i have flow reference. I don't want message goes to default(choice) has…
star
  • 1,493
  • 1
  • 28
  • 61