MCD-LEVEL-1 practice question 7 of 30
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 accountType. What is the correct DataWeave expression to log accountType?
Full set: 235 questionsIn Mule 4, variables created or captured using the Set Variable component are stored in the Mule event's variables collection. To access these variables within DataWeave expressions or component configurations, the vars keyword is used, followed by the specific variable name. Therefore, #[vars.accountType] is the correct DataWeave expression to retrieve and log the value of the accountType variable.
A: flowVars is a legacy Mule 3 concept and is no longer valid in Mule 4 DataWeave 2.0. B: message.inboundProperties is a Mule 3 concept; Mule 4 uses attributes for message metadata. C: attributes accesses message metadata directly (e.g., attributes.queryParams), but the question specifically asks to log the captured variable, not the attribute.
1. MuleSoft Official Documentation, "DataWeave Variables", Mule 4. Available at: https://docs.mulesoft.com/dataweave/2.4/dataweave-variables
2. MuleSoft Official Documentation, "Mule Events and the Mule Message", Mule 4. Available at: https://docs.mulesoft.com/mule-runtime/4.4/mule-message-structure
Keep practicing
Take the free MCD-LEVEL-1 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other MCD-LEVEL-1 practice questions
- Question 3A Mule flow has three Set Variable transformers. What global data structure can be used t…
- Question 8What statement is a part of MuleSoft's description of an application network?
- Question 9A Scatter-Gather processes three separate HTTP requests. Each request returns a Mule even…
- Question 12Which file is used to define the interface contract to invoke a web service implemented a…
- Question 13Correct answer is {customerID}. Reference: https://docs.mulesoft.com/http-connector/1.5/h…
- Question 14An SLA based policy has been enabled in API Manager. What is the next step to configure t…
