Exam MCD - Level 1 All QuestionsBrowse all questions from this 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?

    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
almoraimaOption: A

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

RessSysopOption: A

A is correct

corazonvikingoOption: A

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

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

mubashirhassan2030Option: A

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' } )

ExamDevOption: A

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

martademanzanaOption: A

A is correct

frediepulgosoOption: A

A is correct