MCD-LEVEL-1 · Question #40
Refer to the exhibit. What is a valid expression for the Choice router's when expression to route events to the documenticShipping flow?
The correct answer is B. #[ payload == 'US' J. The Choice router dynamically routes messages through a flow according to a set of DataWeave expressions that evaluate message content. Each expression is associated with a different routing option. The effect is to add conditional processing to a flow, similar to an…
Question
Refer to the exhibit. What is a valid expression for the Choice router’s when expression to route events to the documenticShipping flow?
Exhibit
Options
- A0#[ payload = 'US' ]
- B#[ payload == 'US' J
- C#[ if(payload = 'US') J
- D#[ if(payload == "US") ]
How the community answered
(31 responses)- A3% (1)
- B81% (25)
- C10% (3)
- D6% (2)
Explanation
The Choice router dynamically routes messages through a flow according to a set of DataWeave expressions that evaluate message content. Each expression is associated with a different routing option. The effect is to add conditional processing to a flow, similar to an if/then/else code block in most programming languages. Only one of the routes in the Choice router executes, meaning that the first expression that evaluates to true triggers that route's execution and the others are not checked. If none of the expressions are true, then the default route executes. Properties of <when> PropertyDescription Expression (expression) Expression in DataWeave language to evaluate input. If the expression evaluates to true, this routing option is used: <when expression="#[vars.language == 'Spanish']" > Mulesoft Doc Ref : https://docs.mulesoft.com/mule-runtime/4.3/choice-router-concept With respect to above information , Option 1 is the correct syntax as others are incorrect because of below reasons * Single = is not the correct syntax to validate the condition. It should be ==
Topics
Community Discussion
No community discussion yet for this question.
