user2016
user2016

Reputation: 153

DataWeave - Transformer Mule error "There is no variable named 'message'"

How to display Outbound properties in mule via the DataWeave transformer?

I tried this:

%dw 1.0
%output application/json skipNullOn="everywhere"
---
{
   test_property: message.outboundProperties.testProperty
}

but I get this error: There is no variable named 'message'.

Thanks.

Upvotes: 0

Views: 2457

Answers (1)

tortoise
tortoise

Reputation: 613

invoke directly without using 'message' as shown below

test_property: outboundProperties.testProperty

or else define a flow variable and use it as below

flowvar1: flowVars.flowvar1

Upvotes: 3

Related Questions