What is the correct DataWeave expression to log account Type?

A web client submits a request to http://localhost:8081?accountType=personal. The query parameter is captured using a Set Variable transformer to a variable named account Type.

What is the correct DataWeave expression to log account Type?
A . Account Type: #[flowVars.accountType]
B . Account Type: #[message.inboundProperties.accountType]
C . Account Type: # [attributes.accountType]
D . Account Type: #[vars.accountType]

Answer: D

Explanation:

vars: Keyword for accessing a variable, for example, through a DataWeave expression in a Mule component, such as the Logger, or from an Input or Output parameter of an operation. If the name of your variable is myVar, you can access it like this: vars.myVar Hence correct answer is Account Type: #[vars.accountType]

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments