nerdexam
MuleSoft

MCD-LEVEL-1 · Question #167

Refer to the payload. The Set payload transformer sets the payload to an object. The logger component's message attribute is configured with the string "Result #["INFO"++ payload]" What is the…

The correct answer is C. 1. 1. "You called the function '++' with these arguments. Correct answer is as below as concatenation operation works only with string and not with the objects. In this case payload is object. "You called the function '++' with these arguments: 1: String ("INFO") 2: Object ({student: {name: "Anay" as String {class…

Use DataWeave to transform data

Question

Refer to the payload. The Set payload transformer sets the payload to an object. The logger component's message attribute is configured with the string "Result #["INFO"++ payload]" What is the output of logger when this flow executes?

Exhibit

MCD-LEVEL-1 question #167 exhibit

Options

  • AResult INFOpayload
  • BResult INFO{"student":{"name":"Anay","age":6}}
  • C
      1. "You called the function '++' with these arguments:
  • DError : You evaluated inline expression # without ++

How the community answered

(32 responses)
  • A
    9% (3)
  • B
    28% (9)
  • C
    44% (14)
  • D
    19% (6)

Explanation

Correct answer is as below as concatenation operation works only with string and not with the objects. In this case payload is object. "You called the function '++' with these arguments: 1: String ("INFO") 2: Object ({student: {name: "Anay" as String {class: "java.lang.String"},age

Topics

#DataWeave#string concatenation#type error#operator overloading

Community Discussion

No community discussion yet for this question.

Full MCD-LEVEL-1 Practice