Exam MCD - Level 1 All QuestionsBrowse all questions from this exam
Question 101

Refer to the exhibits.

What payload and quantity are logged at the end of the main flow?

    Correct Answer: C

    The payload processed in the 'For Each' scope does not change outside the scope, hence it remains [1,2,3,4]. The variable 'quantity' starts at 10 and is incremented by 1 during each iteration of the 'For Each' loop. Since the array has four elements, the variable is incremented four times, resulting in a final value of 14. Therefore, the logged payload and quantity are [[1,2,3,4], 14].

Discussion
AaishOption: C

C is the correct answer. updated Variable are accessible after for each scope

Ella_ZOption: C

I tested in Mule4, C is correct Please, why for each are cant change the payload ? [ "a", "b", "c", "d" ], 14 ]

almoraimaOption: B

B is correct

pgarciar

C is correct. The variable is updated in the for each.

chaitind

yes, i have implemented on anypoint studio .

Zumo

B is not Correct. C is the correct Answer. INFO 2021-05-29 16:38:38,378 [[MuleRuntime].uber.46: [batchprocessingtest].q101-flow.CPU_LITE @5014e812] [processor: q101-flow/processors/4; event: 36b4db91-c06e-11eb-bcd9-40b89a99be08] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: [[1, 2, 3, 4], 14]

RahulJain464Option: C

variables can be incremented in for each but payload is not affected in it

BankZenithOption: C

C is correct , in for each payload is not changed but var can be changed.

ExamDevOption: C

C. [[1,2,3,4], 14] - Because for-each scope DOESN'T MODIFY the payload!!!

Maddy_123Option: C

Answer is C [[1, 2, 3, 4], 14]

HonestSeekerOption: C

Logic of why C is correct: a. For Each does not modify the current payload. The output payload is the same as the input. b. The variable value keeps incrementing per iteration and is available outside the For each scope.

miguel_romeroOption: C

C is the correct

awsuser1Option: B

B is correct answer. INFO 2021-08-29 20:48:45,037 [[MuleRuntime].uber.01: [foreach].foreachFlow.CPU_LITE @742deb8f] [processor: foreachFlow/processors/3; event: 1e8b1a20-0902-11ec-b498-a0c589d689a8] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: [[1, 2, 3, 4], 10]