SlideShare a Scribd company logo
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

Soa
SoaSoa
Mule esb beginner’s guide
Mule esb beginner’s guideMule esb beginner’s guide
Mule esb beginner’s guide
D.Rajesh Kumar
 
Mule concepts components
Mule concepts componentsMule concepts components
Mule concepts components
kunal vishe
 
Mule ESB
Mule ESBMule ESB
Mule ESB
niravn
 
Implementing an Esb using Mule
Implementing an Esb using MuleImplementing an Esb using Mule
Implementing an Esb using Mule
AbdulImrankhan7
 
Anypoint connector dev kit
Anypoint connector dev kitAnypoint connector dev kit
Anypoint connector dev kit
Son Nguyen
 
Webbinar slides
Webbinar slidesWebbinar slides
Webbinar slides
WSO2
 
Core concepts in mule
Core concepts in muleCore concepts in mule
Core concepts in mule
Sindhu VL
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
Praneethchampion
 
Mule high availability (ha) cluster
Mule high availability (ha) clusterMule high availability (ha) cluster
Mule high availability (ha) cluster
Achyuta Lakshmi
 
Mulesoft idempotent Message Filter
Mulesoft idempotent Message FilterMulesoft idempotent Message Filter
Mulesoft idempotent Message Filter
kumar gaurav
 
Wso2 esb
Wso2 esbWso2 esb
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-old
F K
 
Anypoint mq (mulesoft) introduction
Anypoint mq (mulesoft)  introductionAnypoint mq (mulesoft)  introduction
Anypoint mq (mulesoft) introduction
Karthik Selvaraj
 
Mule soa
Mule soaMule soa
Mule soa
D.Rajesh Kumar
 
Mule Complete Training
Mule Complete TrainingMule Complete Training
Mule Complete Training
sourabh aggarwal
 
Mule Request Reply
Mule Request ReplyMule Request Reply
Mule Request Reply
Ram Bavireddi
 
Mule requester
Mule requesterMule requester
Mule requester
Sindhu VL
 
Service orchestration and soa
Service orchestration and soaService orchestration and soa
Service orchestration and soa
D.Rajesh Kumar
 
Mule esb
Mule esbMule esb
Mule esb
Naresh Naidu
 

What's hot (20)

Soa
SoaSoa
Soa
 
Mule esb beginner’s guide
Mule esb beginner’s guideMule esb beginner’s guide
Mule esb beginner’s guide
 
Mule concepts components
Mule concepts componentsMule concepts components
Mule concepts components
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
Implementing an Esb using Mule
Implementing an Esb using MuleImplementing an Esb using Mule
Implementing an Esb using Mule
 
Anypoint connector dev kit
Anypoint connector dev kitAnypoint connector dev kit
Anypoint connector dev kit
 
Webbinar slides
Webbinar slidesWebbinar slides
Webbinar slides
 
Core concepts in mule
Core concepts in muleCore concepts in mule
Core concepts in mule
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
 
Mule high availability (ha) cluster
Mule high availability (ha) clusterMule high availability (ha) cluster
Mule high availability (ha) cluster
 
Mulesoft idempotent Message Filter
Mulesoft idempotent Message FilterMulesoft idempotent Message Filter
Mulesoft idempotent Message Filter
 
Wso2 esb
Wso2 esbWso2 esb
Wso2 esb
 
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-old
 
Anypoint mq (mulesoft) introduction
Anypoint mq (mulesoft)  introductionAnypoint mq (mulesoft)  introduction
Anypoint mq (mulesoft) introduction
 
Mule soa
Mule soaMule soa
Mule soa
 
Mule Complete Training
Mule Complete TrainingMule Complete Training
Mule Complete Training
 
Mule Request Reply
Mule Request ReplyMule Request Reply
Mule Request Reply
 
Mule requester
Mule requesterMule requester
Mule requester
 
Service orchestration and soa
Service orchestration and soaService orchestration and soa
Service orchestration and soa
 
Mule esb
Mule esbMule esb
Mule esb
 

Viewers also liked

Trade unions
Trade unionsTrade unions
Trade unions
Sharon Mansoor
 
Speed worksheet
Speed worksheetSpeed worksheet
Speed worksheet
mariaalmarcha2002
 
Juárez dijo no. Historieta Histórica
Juárez dijo no. Historieta HistóricaJuárez dijo no. Historieta Histórica
Juárez dijo no. Historieta Histórica
avitiadgo
 
Untitled6
Untitled6Untitled6
Untitled6hpenny3
 
Dispositivos inteligentes
Dispositivos inteligentes Dispositivos inteligentes
Dispositivos inteligentes
cr-peinado
 
NACD CERTIFICATION 6-5-2014
NACD CERTIFICATION 6-5-2014NACD CERTIFICATION 6-5-2014
NACD CERTIFICATION 6-5-2014Lila Salem
 
Tatuajes
TatuajesTatuajes
Tatuajes
patolina2390
 
Oh my good tapas, oferta los jueves
Oh my good tapas, oferta los juevesOh my good tapas, oferta los jueves
Oh my good tapas, oferta los jueves
Oh my good tapas
 
Resume
ResumeResume
Resume
Zach Roper
 
Mapa conceptual del plan y programas 2011. pag 41-48
Mapa conceptual del plan y programas 2011. pag 41-48Mapa conceptual del plan y programas 2011. pag 41-48
Mapa conceptual del plan y programas 2011. pag 41-48
Antonieta Valdez Cardenas
 
Sharplan 40C CO2 Laser
Sharplan 40C CO2 LaserSharplan 40C CO2 Laser
Sharplan 40C CO2 Lasernissim_shaked
 
Future of management
Future of managementFuture of management
Future of management
Sharon Mansoor
 

Viewers also liked (12)

Trade unions
Trade unionsTrade unions
Trade unions
 
Speed worksheet
Speed worksheetSpeed worksheet
Speed worksheet
 
Juárez dijo no. Historieta Histórica
Juárez dijo no. Historieta HistóricaJuárez dijo no. Historieta Histórica
Juárez dijo no. Historieta Histórica
 
Untitled6
Untitled6Untitled6
Untitled6
 
Dispositivos inteligentes
Dispositivos inteligentes Dispositivos inteligentes
Dispositivos inteligentes
 
NACD CERTIFICATION 6-5-2014
NACD CERTIFICATION 6-5-2014NACD CERTIFICATION 6-5-2014
NACD CERTIFICATION 6-5-2014
 
Tatuajes
TatuajesTatuajes
Tatuajes
 
Oh my good tapas, oferta los jueves
Oh my good tapas, oferta los juevesOh my good tapas, oferta los jueves
Oh my good tapas, oferta los jueves
 
Resume
ResumeResume
Resume
 
Mapa conceptual del plan y programas 2011. pag 41-48
Mapa conceptual del plan y programas 2011. pag 41-48Mapa conceptual del plan y programas 2011. pag 41-48
Mapa conceptual del plan y programas 2011. pag 41-48
 
Sharplan 40C CO2 Laser
Sharplan 40C CO2 LaserSharplan 40C CO2 Laser
Sharplan 40C CO2 Laser
 
Future of management
Future of managementFuture of management
Future of management
 

Similar to Mule-choice component

Choice component
Choice component Choice component
Choice component
Sunil Komarapu
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule
Rajkattamuri
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
javeed_mhd
 
Mule Choice component
Mule Choice component Mule Choice component
Mule Choice component
AbdulImrankhan7
 
Choice component
Choice component Choice component
Choice component
F K
 
For Each Component
For Each ComponentFor Each Component
For Each Component
Durga Prasad Kakarla
 
How to use for each component
How to use for each componentHow to use for each component
How to use for each component
maheshtheapex
 
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 mule
javeed_mhd
 
For each component
For each component For each component
For each component
Sunil Komarapu
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
Rajkattamuri
 
For each component
For each component For each component
For each component
AbdulImrankhan7
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demo
Sudha 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 call
prathyusha vadla
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
maheshtheapex
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
javeed_mhd
 
Message properties component
Message properties component Message properties component
Message properties component
Sunil Komarapu
 
Message properties component
Message properties componentMessage properties component
Message properties component
F K
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
princeirfancivil
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
irfan1008
 

Similar to Mule-choice component (20)

Choice component
Choice component Choice component
Choice component
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
 
Mule Choice component
Mule Choice component Mule Choice component
Mule Choice component
 
Choice component
Choice component Choice component
Choice 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
 
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
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 in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
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
 

Recently uploaded

GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 

Recently uploaded (20)

GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 

Mule-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