Star
Star

Reputation: 1503

How to Extract the Flow Name and MessageProcessor Name using MEL - MULE ESB

I'm not sure, how can we extract the flow-name and message-processor Name through MEL. For example I have multiple message processor. For logging, i need to extract the flow Name and Message-processor, so that I can find out transaction has crossed this particular flow and its message processor. Is there any simple way to find out. Please guide me. Please find the screenshot below. Here i need to Extract - set payload and its flowName (flow1)

enter image description here

Thanks in advance.

Upvotes: 1

Views: 4622

Answers (4)

Sanjeet Pandey
Sanjeet Pandey

Reputation: 546

Two ways to acthive this (from current flow name)

First one is -

<logger message="Current flowName: #[flow.name]" level="INFO" doc:name="Logger"/>

and the second one is -

<logger message="Current flowName: #[context:serviceName]" level="INFO" doc:name="Logger"/>

Upvotes: 0

Star
Star

Reputation: 1503

For mule 3.8+ version onwards #[flow.name] don't work.

Use #[mule:context.serviceName] expression in logger or component to extract the name of the flow

Upvotes: 3

a.cayzer
a.cayzer

Reputation: 289

I know this post is old but I have been trying to find a way to do this in MEL for error handling emails.

For the flow name you can use #[exception.event.flowConstruct.name] for the failing message processor you can use #[exception.failingMessageProcessor].

Both of these work in MEL without the need to use an flowVar.

Please note however, that the failing processor does not always come back with a value but comes back with null, I'm not sure why.

Upvotes: 2

Julio Cejas
Julio Cejas

Reputation: 573

You can extract the flow-name with MEL : #[flow.name]

<flow name="name" doc:name="name">
    <http:inbound-endpoint address="http://localhost:8090/resources" doc:name="HTTP" />
    <logger message="name of flow: #[flow.name]" level="INFO" doc:name="Logger"/>
    <set-payload value="name" doc:name="Set Payload"/>
</flow>

or

flowConstruct.getName() in a Message Processor

Upvotes: 1

Related Questions