nerdexam
MuleSoft

MCD-LEVEL-1 · Question #6

Refer to the exhibits. What payload is logged at the end of the main flow?

The correct answer is B. [1, 2, 3, 4]. The For Each scope splits a payload into elements and processes them one by one through the components that you place in the scope. It is similar to a for-each/for loop code block in most programming languages and can process any collection, including lists and arrays. The…

Mule 4 Application Development

Question

Refer to the exhibits. What payload is logged at the end of the main flow?

Exhibit

MCD-LEVEL-1 question #6 exhibit

Options

  • A[order1, order2, order3, order4]
  • B[1, 2, 3, 4]
  • Corder4
  • Dorder1order2order3order4

How the community answered

(33 responses)
  • A
    6% (2)
  • B
    79% (26)
  • C
    12% (4)
  • D
    3% (1)

Explanation

The For Each scope splits a payload into elements and processes them one by one through the components that you place in the scope. It is similar to a for-each/for loop code block in most programming languages and can process any collection, including lists and arrays. The collection can be any supported content type, such as application/json, application/java, or application/xml. General considerations about the For Each scope: By default, For Each tries to split the payload. If the payload is a simple Java collection, the For Each scope can split it without any configuration. The payload inside the For Each scope is each of the split elements. Attributes within the original message are ignored because they are related to the entire For Each does not modify the current payload. The output payload is the same as the input. Mule Doc Reference : https://docs.mulesoft.com/mule-runtime/4.3/for-each-scope-concept

Topics

#For Each scope#payload aggregation#flow execution#DataWeave

Community Discussion

No community discussion yet for this question.

Full MCD-LEVEL-1 Practice