MCD - Level 1 Exam QuestionsBrowse all questions from this exam

MCD - Level 1 Exam - Question 104


Refer to the exhibits.

The Set Payload transformer in the addItem child flow uses DataWeave to create an order object.

What is the correct DataWeave code for the Set Payload transformer in the createOrder flow to use the addItem child flow to add a router cal with the price of 100 to the order?

Show Answer
Correct Answer: A

To call the 'addItem' child flow and add a router with the price of 100 to the order, the correct DataWeave code in the Set Payload transformer should make use of the 'lookup' function. The 'lookup' function is used to invoke another flow and pass the necessary payload to it. Therefore, the correct DataWeave code is 'lookup("addItem", { price: "100", item: "router", itemType: "cable" })'. This code correctly specifies the flow to be called along with the payload in the required format.

Discussion

7 comments
Sign in to comment
almoraimaOption: A
Mar 28, 2021

A is correct https://docs.mulesoft.com/mule-runtime/4.3/dw-mule-functions-lookup

RessSysopOption: A
Jul 10, 2021

A is correct

mubashirhassan2030Option: A
Nov 27, 2021

A. lookup( 'addItem', { price: '100', item: 'router', itemType: 'cable' } ) B. addItem( { payload: { price: '100', item: 'router'. itemType: 'cable' } } ) C. lookup( 'addItem', { payload: { price: '100', item: 'router', itemType: 'cable' } } ) D. addItem( { price: '100', item: 'router'. itemType: 'cable' } )

corazonvikingoOption: A
Oct 13, 2023

Yes, A seems correct according to MuleSoft's own documentation. But since Dataweave version 2.5, the documentation also says that the lookup function is deprecated and that flow reference is recommended instead.

Alandt
Feb 7, 2024

That's true, I'm guessing we won't get any Lookup questions but instead we will get flow-ref.

frediepulgosoOption: A
Mar 7, 2022

A is correct

martademanzanaOption: A
Nov 13, 2023

A is correct

ExamDevOption: A
Jan 23, 2024

A. lookup( "addItem", { price: "100", item: "router", itemType: "cable" } ) - The first argument is for what flow to be called - The second argument is the payload