SlideShare a Scribd company logo
1 of 8
How to use Choice component
28-09-2014
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

Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mulejaveed_mhd
 
Mule connector for ibm® as400
Mule connector for ibm® as400Mule connector for ibm® as400
Mule connector for ibm® as400D.Rajesh Kumar
 
MuleSoft ESB Routes first-successful
MuleSoft ESB Routes first-successfulMuleSoft ESB Routes first-successful
MuleSoft ESB Routes first-successfulakashdprajapati
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mulejaveed_mhd
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demoSudha Ch
 
Basic example using message properties component
Basic example using message properties componentBasic example using message properties component
Basic example using message properties componentprudhvivreddy
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo javeed_mhd
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mulejaveed_mhd
 
Basic example using choice component
Basic example using choice componentBasic example using choice component
Basic example using choice componentprudhvivreddy
 

What's hot (15)

Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Mule connector for ibm® as400
Mule connector for ibm® as400Mule connector for ibm® as400
Mule connector for ibm® as400
 
MuleSoft ESB Routes first-successful
MuleSoft ESB Routes first-successfulMuleSoft ESB Routes first-successful
MuleSoft ESB Routes first-successful
 
Object store
Object storeObject store
Object store
 
Sftplite
SftpliteSftplite
Sftplite
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
 
Configurare http mule
Configurare http muleConfigurare http mule
Configurare http mule
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demo
 
Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
 
Basic example using message properties component
Basic example using message properties componentBasic example using message properties component
Basic example using message properties component
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
 
Basic example using choice component
Basic example using choice componentBasic example using choice component
Basic example using choice component
 

Viewers also liked

Sto sro p6054294800030-2013
Sto sro p6054294800030-2013Sto sro p6054294800030-2013
Sto sro p6054294800030-2013donic torreto
 
Top 14 qc interview tips
Top 14 qc interview tipsTop 14 qc interview tips
Top 14 qc interview tipsqccareer
 
Canadá ana zarza - tratados y acuerdos
Canadá   ana zarza - tratados y acuerdosCanadá   ana zarza - tratados y acuerdos
Canadá ana zarza - tratados y acuerdosCatalina Zarza
 
Internet addictiontestresearch
Internet addictiontestresearchInternet addictiontestresearch
Internet addictiontestresearchtakuahs
 
Audience research questionnaire
Audience research questionnaireAudience research questionnaire
Audience research questionnaireAS Media Column E
 
Fundamentals of Property Presentation
Fundamentals of Property PresentationFundamentals of Property Presentation
Fundamentals of Property PresentationChristopher Balbuena
 

Viewers also liked (14)

Sto sro p6054294800030-2013
Sto sro p6054294800030-2013Sto sro p6054294800030-2013
Sto sro p6054294800030-2013
 
Mri english a4
Mri english a4Mri english a4
Mri english a4
 
Top 14 qc interview tips
Top 14 qc interview tipsTop 14 qc interview tips
Top 14 qc interview tips
 
Canadá ana zarza - tratados y acuerdos
Canadá   ana zarza - tratados y acuerdosCanadá   ana zarza - tratados y acuerdos
Canadá ana zarza - tratados y acuerdos
 
U1 c3 caso l molina propuesto
U1 c3 caso l molina propuestoU1 c3 caso l molina propuesto
U1 c3 caso l molina propuesto
 
La novia envidiosa
La novia envidiosaLa novia envidiosa
La novia envidiosa
 
Internet addictiontestresearch
Internet addictiontestresearchInternet addictiontestresearch
Internet addictiontestresearch
 
Beyond Fear
Beyond FearBeyond Fear
Beyond Fear
 
Audience research questionnaire
Audience research questionnaireAudience research questionnaire
Audience research questionnaire
 
Comm Computation at IRSC
Comm Computation at IRSCComm Computation at IRSC
Comm Computation at IRSC
 
Fundamentals of Property Presentation
Fundamentals of Property PresentationFundamentals of Property Presentation
Fundamentals of Property Presentation
 
Seller Referral Agreement
Seller Referral AgreementSeller Referral Agreement
Seller Referral Agreement
 
couples seeking men
couples seeking mencouples seeking men
couples seeking men
 
Chevrolet Volt 2014
Chevrolet Volt 2014Chevrolet Volt 2014
Chevrolet Volt 2014
 

Similar to How to use choice component

Choice component
Choice component Choice component
Choice component F K
 
Choice component in mule
Choice component in muleChoice component in mule
Choice 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
 
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
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demoSudha Ch
 
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
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentmaheshtheapex
 
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 componentprinceirfancivil
 
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
 

Similar to How to use choice component (20)

Choice component
Choice component Choice component
Choice component
 
Mule Choice component
Mule Choice component Mule Choice component
Mule Choice component
 
Choice component
Choice component Choice component
Choice component
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
 
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
 
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 in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demo
 
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
 
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
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 poll scope
How to use poll scopeHow to use poll scope
How to use poll scope
 

Recently uploaded

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Recently uploaded (20)

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

How to use choice component

  • 1. How to use Choice component 28-09-2014
  • 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