MCD - Level 1 Exam QuestionsBrowse all questions from this exam

MCD - Level 1 Exam - Question 141


Refer to the exhibits. In the Choice router, the When expression for the domesticShipping route is set to “#[payload =’FR’]”

What is logged after the Choice router completes?

Show Answer
Correct Answer: C

The Choice router's When expression uses a single equal sign ('='), which is incorrect for DataWeave syntax in MuleSoft. The correct syntax to compare values in DataWeave is '=='. Therefore, the router's expression will cause a syntax error.

Discussion

4 comments
Sign in to comment
dendarmOption: C
Dec 19, 2022

Will fail and throw dataweave error, the correct syntax for the when clause would be: payload == 'FR'

[Removed]
Jan 13, 2023

True, there should be a red circle with exclamation mark in the picture. The image was edited...

RanjansinghOption: B
Feb 8, 2023

B syntax error, tested locally

Ranjansingh
Feb 8, 2023

Typo error, it's C - Syntax error (not B)

ibrahim_akbiyikOption: C
Apr 27, 2023

To compare, DataWeave syntax is #[payload == "FR"]. In this case only one = is used so it will give syntax error.

ExamDevOption: B
Jan 24, 2024

Will fail and throw dataweave error, the correct syntax for the when clause would be: payload == 'FR'

Alandt
Feb 5, 2024

You mean C, right?