SlideShare a Scribd company logo
1 of 8
Choice Component In Mule Demo
Abstract
• The main motto of this PPT is how to use
Choice component in our applications.
Introduction
• The choice flow control dynamically routes
messages based on message payload or
properties. It adds conditional programming
to a flow, similar to an if/then/elsecode block.
Example
• .mflow
• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm" 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" version="EE-
3.4.0" 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/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.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">
• <flow name="MessagePropertiesFlow1" doc:name="MessagePropertiesFlow1">
• <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8089" path="choice" doc:name="HTTP"/>
• <message-properties-transformer scope="session" doc:name="Message Properties">
• <add-message-property key="property1" value="mule"/>
• </message-properties-transformer>
• <logger message="--flow1--#[sessionVars['property1']]" level="INFO" doc:name="Logger"/>
• <vm:outbound-endpoint exchange-pattern="request-response" path="messageproperties" doc:name="VM"/>
• </flow>
• <flow name="MessagePropertiesFlow2" doc:name="MessagePropertiesFlow2">
• <vm:inbound-endpoint exchange-pattern="request-response" path="messageproperties" doc:name="VM"/>
• <logger message="---flow2--#[sessionVars['property1']]" level="INFO" doc:name="Logger"/>
• <choice doc:name="Choice">
• <when expression="#[sessionVars['property1']=='mule']">
• <logger message="--the value of session property (property1) is 'mule'" level="INFO" doc:name="Logger"/>
• </when>
• <otherwise>
• <logger message="--the value of session property (property1) is not 'mule'" level="INFO" doc:name="Logger"/>
• </otherwise>
• </choice>
• </flow>
• </mule>
• Output:
• INFO 2015-10-03 16:00:23,705 [[messageproperties].config.change.14.thread.1] org.mule.DefaultMuleContext:
• **********************************************************************
• * Application: messageproperties *
• * OS encoding: Cp1252, Mule encoding: UTF-8 *
• * *
• * Agents Running: *
• * Clustering Agent *
• * JMX Agent *
• **********************************************************************
• INFO 2015-10-03 16:00:23,706 [[messageproperties].config.change.14.thread.1]
org.mule.module.launcher.MuleDeploymentService:
• ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
• + Started app 'messageproperties' +
• ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
• INFO 2015-10-03 16:00:26,480 [[messageproperties].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: --flow1--mule--studio
• INFO 2015-10-03 16:00:26,482 [[messageproperties].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.VM.mule.default.dispatcher.771015974'.
Object is: VMMessageDispatcher
• INFO 2015-10-03 16:00:26,482 [[messageproperties].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.VM.mule.default.dispatcher.771015974'. Object
is: VMMessageDispatcher
• INFO 2015-10-03 16:00:26,489 [[messageproperties].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: ---flow2--mule--studio
• Flow of execution:
1. URL to trigger the service from browser
http://localhost:8089/choice
2. session property is created using message
property component In flow1
3. Service displays session properties in flow1,
flow2
4. In flow2 the choice component checks the
value of the session property is ‘mule’ or not, if
true then it displays “the value of session
property (property1) is 'mule” else it goes and
displays data in default component
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.5/choice-flow-control-reference

More Related Content

What's hot

File component in mule
File component in muleFile component in mule
File component in muleRajkattamuri
 
For each component in mule
For each component in muleFor each component in mule
For each component in muleRajkattamuri
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demoSudha Ch
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbPraneethchampion
 
Mule chapter2
Mule chapter2Mule chapter2
Mule chapter2mha4
 
Mule esb
Mule esbMule esb
Mule esbKhan625
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notificationsShanky Gupta
 
Database component in mule demo
Database component in mule demoDatabase component in mule demo
Database component in mule demoSudha Ch
 
Creating restful api using mule esb
Creating restful api using mule esbCreating restful api using mule esb
Creating restful api using mule esbRaviShankar Mishra
 
Choice router mule
Choice router   muleChoice router   mule
Choice router muleSindhu VL
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mulejaveed_mhd
 

What's hot (18)

Mule property placeholder
Mule property placeholderMule property placeholder
Mule property placeholder
 
File component in mule
File component in muleFile component in mule
File component in mule
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demo
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule chapter2
Mule chapter2Mule chapter2
Mule chapter2
 
Mule esb
Mule esbMule esb
Mule esb
 
Propertiesinmule
PropertiesinmulePropertiesinmule
Propertiesinmule
 
Configurare http mule
Configurare http muleConfigurare http mule
Configurare http mule
 
Mule soa
Mule soaMule soa
Mule soa
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notifications
 
Mule introduction
Mule introductionMule introduction
Mule introduction
 
Database component in mule demo
Database component in mule demoDatabase component in mule demo
Database component in mule demo
 
Creating restful api using mule esb
Creating restful api using mule esbCreating restful api using mule esb
Creating restful api using mule esb
 
Choice router mule
Choice router   muleChoice router   mule
Choice router mule
 
Mule 3.8
Mule 3.8Mule 3.8
Mule 3.8
 
Mule batch processing
Mule  batch processingMule  batch processing
Mule batch processing
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 

Viewers also liked

Mule esb anypoint studio Tour
Mule esb anypoint studio TourMule esb anypoint studio Tour
Mule esb anypoint studio Tourveena naresh
 
Certificate-Office 10 Basic
Certificate-Office 10 BasicCertificate-Office 10 Basic
Certificate-Office 10 BasicMarko Malinic
 
Patron Letter of thanks
Patron Letter of thanksPatron Letter of thanks
Patron Letter of thanksKim Rubin
 
Mapping and listing in mule
Mapping and listing in muleMapping and listing in mule
Mapping and listing in muleKhan625
 
Flows and subflows in mule
Flows and subflows in muleFlows and subflows in mule
Flows and subflows in muleSindhu VL
 
Nursing diagnosis
Nursing diagnosisNursing diagnosis
Nursing diagnosisArul Valan
 

Viewers also liked (8)

Fotosc fachada colegio
Fotosc fachada colegioFotosc fachada colegio
Fotosc fachada colegio
 
Mule esb anypoint studio Tour
Mule esb anypoint studio TourMule esb anypoint studio Tour
Mule esb anypoint studio Tour
 
Mule esb
Mule esbMule esb
Mule esb
 
Certificate-Office 10 Basic
Certificate-Office 10 BasicCertificate-Office 10 Basic
Certificate-Office 10 Basic
 
Patron Letter of thanks
Patron Letter of thanksPatron Letter of thanks
Patron Letter of thanks
 
Mapping and listing in mule
Mapping and listing in muleMapping and listing in mule
Mapping and listing in mule
 
Flows and subflows in mule
Flows and subflows in muleFlows and subflows in mule
Flows and subflows in mule
 
Nursing diagnosis
Nursing diagnosisNursing diagnosis
Nursing diagnosis
 

Similar to Choice component in mule

Mule-choice component
Mule-choice componentMule-choice component
Mule-choice componentDivyaSree1391
 
How to use choice component
How to use choice componentHow to use choice component
How to use choice componentmaheshtheapex
 
For each component
For each component For each component
For each component F K
 
For each component in mule
For each component in muleFor each component in mule
For each component in mulejaveed_mhd
 
How to use for each component
How to use for each componentHow to use for each component
How to use for each componentmaheshtheapex
 
How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure callprathyusha vadla
 
Message properties component
Message properties component Message properties component
Message properties component Sunil Komarapu
 
Message properties component
Message properties componentMessage properties component
Message properties componentF K
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentirfan1008
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentPhaniu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmdfkhan625
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentprinceirfancivil
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmaheshtheapex
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentSunil Komarapu
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentKhasim Saheb
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in MuleKhan625
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentAnand kalla
 

Similar to Choice component in mule (20)

Mule-choice component
Mule-choice componentMule-choice component
Mule-choice component
 
How to use choice component
How to use choice componentHow to use choice component
How to use choice component
 
For each component
For each component For each component
For each component
 
For each component
For each component For each component
For each component
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
For each component
For each component For each component
For each component
 
For Each Component
For Each ComponentFor Each Component
For Each Component
 
How to use for each component
How to use for each componentHow to use for each component
How to use for each component
 
How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure call
 
Message properties component
Message properties component Message properties component
Message properties component
 
Message properties component
Message properties componentMessage properties component
Message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 

More from javeed_mhd

Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mulejaveed_mhd
 
File component in mule
File component in muleFile component in mule
File component in mulejaveed_mhd
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mulejaveed_mhd
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mulejaveed_mhd
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mulejaveed_mhd
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mulejaveed_mhd
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation javeed_mhd
 
Mule esb made system integration easy
Mule esb made system integration easy Mule esb made system integration easy
Mule esb made system integration easy javeed_mhd
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo javeed_mhd
 
How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint javeed_mhd
 
How to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudioHow to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudiojaveed_mhd
 
Mapping and listing with mule
Mapping and listing with mule Mapping and listing with mule
Mapping and listing with mule javeed_mhd
 
Mule any point exchange
Mule any point exchangeMule any point exchange
Mule any point exchangejaveed_mhd
 
Mule esb api layer
Mule esb api layer Mule esb api layer
Mule esb api layer javeed_mhd
 
Mule Maven Plugin
Mule Maven PluginMule Maven Plugin
Mule Maven Pluginjaveed_mhd
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripejaveed_mhd
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedurejaveed_mhd
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalonejaveed_mhd
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in mulejaveed_mhd
 

More from javeed_mhd (20)

Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
File component in mule
File component in muleFile component in mule
File component in mule
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mule
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation
 
Mule esb made system integration easy
Mule esb made system integration easy Mule esb made system integration easy
Mule esb made system integration easy
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint
 
How to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudioHow to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudio
 
Mapping and listing with mule
Mapping and listing with mule Mapping and listing with mule
Mapping and listing with mule
 
Mule any point exchange
Mule any point exchangeMule any point exchange
Mule any point exchange
 
Mule esb api layer
Mule esb api layer Mule esb api layer
Mule esb api layer
 
Mule Maven Plugin
Mule Maven PluginMule Maven Plugin
Mule Maven Plugin
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalone
 
Presentation
PresentationPresentation
Presentation
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in mule
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 

Choice component in mule

  • 2. Abstract • The main motto of this PPT is how to use Choice component in our applications.
  • 3. Introduction • The choice flow control dynamically routes messages based on message payload or properties. It adds conditional programming to a flow, similar to an if/then/elsecode block.
  • 5. • .mflow • <?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" 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" version="EE- 3.4.0" 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/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.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"> • <flow name="MessagePropertiesFlow1" doc:name="MessagePropertiesFlow1"> • <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8089" path="choice" doc:name="HTTP"/> • <message-properties-transformer scope="session" doc:name="Message Properties"> • <add-message-property key="property1" value="mule"/> • </message-properties-transformer> • <logger message="--flow1--#[sessionVars['property1']]" level="INFO" doc:name="Logger"/> • <vm:outbound-endpoint exchange-pattern="request-response" path="messageproperties" doc:name="VM"/> • </flow> • <flow name="MessagePropertiesFlow2" doc:name="MessagePropertiesFlow2"> • <vm:inbound-endpoint exchange-pattern="request-response" path="messageproperties" doc:name="VM"/> • <logger message="---flow2--#[sessionVars['property1']]" level="INFO" doc:name="Logger"/> • <choice doc:name="Choice"> • <when expression="#[sessionVars['property1']=='mule']"> • <logger message="--the value of session property (property1) is 'mule'" level="INFO" doc:name="Logger"/> • </when> • <otherwise> • <logger message="--the value of session property (property1) is not 'mule'" level="INFO" doc:name="Logger"/> • </otherwise> • </choice> • </flow> • </mule>
  • 6. • Output: • INFO 2015-10-03 16:00:23,705 [[messageproperties].config.change.14.thread.1] org.mule.DefaultMuleContext: • ********************************************************************** • * Application: messageproperties * • * OS encoding: Cp1252, Mule encoding: UTF-8 * • * * • * Agents Running: * • * Clustering Agent * • * JMX Agent * • ********************************************************************** • INFO 2015-10-03 16:00:23,706 [[messageproperties].config.change.14.thread.1] org.mule.module.launcher.MuleDeploymentService: • ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ • + Started app 'messageproperties' + • ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ • INFO 2015-10-03 16:00:26,480 [[messageproperties].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: --flow1--mule--studio • INFO 2015-10-03 16:00:26,482 [[messageproperties].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.VM.mule.default.dispatcher.771015974'. Object is: VMMessageDispatcher • INFO 2015-10-03 16:00:26,482 [[messageproperties].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.VM.mule.default.dispatcher.771015974'. Object is: VMMessageDispatcher • INFO 2015-10-03 16:00:26,489 [[messageproperties].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: ---flow2--mule--studio
  • 7. • Flow of execution: 1. URL to trigger the service from browser http://localhost:8089/choice 2. session property is created using message property component In flow1 3. Service displays session properties in flow1, flow2 4. In flow2 the choice component checks the value of the session property is ‘mule’ or not, if true then it displays “the value of session property (property1) is 'mule” else it goes and displays data in default component