<< Prev Question Next Question >>

Question 7/12

Refer to the exhibits.

The Set Payload transformer In the addltem subflow 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 addltem subflow to add a router cable with the price of 100 to the order?

Recent Comments (The most recent comments are at the top.)

Saravanan Devadass - Mar 14, 2022

Correct Answer is A

<flow name="CreateOrder" doc:id="ad8e3673-edf4-405b-bf1d-916588e17d0f" >
<http:listener doc:name="order1" doc:id="12cf3402-63bb-42ad-9024-eefe5df7557c" config-ref="HTTP_Listener_config" path="order1"/>
<set-payload value='#[output application/json
&#10;---
&#10;Mule::lookup("AddItem", {item: "Product1", "itemType": "Sales", price: 300}, 60000)]' doc:name="Set Payload" doc:id="b85bcd74-17e4-4249-96b2-41bae00ad902" />
<logger level="INFO" doc:name="Logger" doc:id="d569a473-57e4-46e0-be11-186313403d24" message='#["Payload in order1 is #[payload]"]'/>
</flow>
<flow name="AddItem" doc:id="093a945c-e65d-47f9-9fa2-0d59cf3ddab2" >
<set-payload value='#[output application/json
&#10;---
&#10;Orders: {
&#10; Order:{
&#10; Item: payload.item,
&#10; "ItemType": payload.itemType,
&#10; Price: payload.price
&#10; }
&#10;}]' doc:name="Set Payload" doc:id="ef152983-4460-4529-8323-415c5132499c" />
<logger level="INFO" doc:name="Logger" doc:id="d89ed53d-48ed-4dbe-936d-1230b13a42cc" message='#["Payload in addItem is #[payload]"]'/>
</flow>...

Mk - Oct 10, 2021

The correct answer is A

Mk - Oct 10, 2021

Answer is B

LEAVE A REPLY

Your email address will not be published. Required fields are marked *