Route messages dynamically 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.
To configure the Choice router, specify one or more conditions to evaluate, and the message processors that execute when any condition evaluates to true. Additionally, configure a default route that executes when none of the defined conditions are true.