Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Conditional Flows with Choice Router Challenge
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<flow name="choice_flow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/choose" doc:name="HTTP"/>
<set-variable variableName="value" value="#[message.inboundProperties.'http.query.params'.value]" doc:name="choice path"/>
<choice doc:name="Choice">
<when expression="#[flowVars.value == '1']">
<logger message="Entered first route" level="INFO" doc:name="Logger"/>
</when>
<when expression="#[flowVars.value == 'one']">
<logger message="Entered second route" level="INFO" doc:name="Logger"/>
</when>
<otherwise>
<logger message="Entered third route" level="INFO" doc:name="Logger"/>
</otherwise>
</choice>
</flow>
</mule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.