Recent Posts
Archives

Posts Tagged ‘Mule 3’

PostHeaderIcon How to access global variables in Mule 3?

Case

In Mule 2.2.1, getting the global variables was allowed. Therefore, such a block worked:

[xml]
<add-message-property key="jonathanProperty"
value="#[groovy:MULE_ORIGINATING_ENDPOINT]" />[/xml]

In Mule 3, this is no more possible. Therefore, how to access -former- global variables within a Mule 3 config file?

Fix

Access the global variables owing to their scope, such as Invocation, Inbound, Outbound, Session, thanks to the methods MuleMessage.get<Scope>Property(), eg:

[xml]<add-message-property key="jonathanProperty"
value="#[groovy:message.getInboundProperty(&quot;MULE_ORIGINATING_ENDPOINT&quot;)]" />[/xml]