SlideShare a Scribd company logo
1 of 7
How to use Expression Filter
Abstract
ā€¢ The main motto of this PPT is how to use
Expression filter in our applications.
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="expressionfilter" doc:name="HTTP"/>
ā€¢ <message-properties-transformer scope="session" doc:name="Message Properties">
ā€¢ <add-message-property key="property1" value="mule studio"/>
ā€¢ </message-properties-transformer>
ā€¢ <logger message="--flow1--#[sessionVars['property1']]" level="INFO" doc:name="Logger"/>
ā€¢ <expression-filter expression="#[sessionVars['property1']!='mule']" doc:name="Expression"/>
ā€¢ <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"/>
ā€¢ </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/expressionfilter
2. session property is created using message
property component In flow1
3. Service displays session properties in flow1
4. VM component in flow1 will call flow2 if the
value of the session property is other then mule.
5. In the POC the session property value is ā€œmule
studioā€ so flow1 calls flow2 and displays session
property value in flow2
References
ā€¢ https://docs.mulesoft.com/mule-
fundamentals/v/3.7/mule-filters-scopes-and-
routers

More Related Content

What's hot (12)

Wildcard Filter
Wildcard FilterWildcard Filter
Wildcard Filter
Ā 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
Ā 
Salesforce
SalesforceSalesforce
Salesforce
Ā 
Data Mapper
Data MapperData Mapper
Data Mapper
Ā 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
Ā 
Property place holder
Property place holderProperty place holder
Property place holder
Ā 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
Ā 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
Ā 
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
Ā 
Splitter
SplitterSplitter
Splitter
Ā 
Not Filter
Not FilterNot Filter
Not Filter
Ā 
Or Filter
Or FilterOr Filter
Or Filter
Ā 

Viewers also liked

Viewers also liked (20)

Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
Ā 
Introduction to mule esb
Introduction to mule esbIntroduction to mule esb
Introduction to mule esb
Ā 
Mule velocity
Mule velocityMule velocity
Mule velocity
Ā 
Mule security
Mule securityMule security
Mule security
Ā 
Mule quartz
Mule quartz Mule quartz
Mule quartz
Ā 
Soap request in mule
Soap request in mule Soap request in mule
Soap request in mule
Ā 
Damaging damzelz' no.1
Damaging damzelz' no.1Damaging damzelz' no.1
Damaging damzelz' no.1
Ā 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
Ā 
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
Ā 
Documantation with mule
Documantation with mule Documantation with mule
Documantation with mule
Ā 
xslt in mule
xslt in mulexslt in mule
xslt in mule
Ā 
Groovy in Mule
Groovy in MuleGroovy in Mule
Groovy in Mule
Ā 
Mmc rest api user groups
Mmc rest api user groups Mmc rest api user groups
Mmc rest api user groups
Ā 
Mule technology
Mule technologyMule technology
Mule technology
Ā 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
Ā 
Mule batch processing
Mule batch processingMule batch processing
Mule batch processing
Ā 
CSP Review Report_Final (1)
CSP Review Report_Final (1)CSP Review Report_Final (1)
CSP Review Report_Final (1)
Ā 
Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchange
Ā 
Mule oracle connectors
Mule oracle connectorsMule oracle connectors
Mule oracle connectors
Ā 
Mule soap
Mule soapMule soap
Mule soap
Ā 

Similar to How to use expression filter

Similar to How to use expression filter (20)

How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Ā 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Ā 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Ā 
Filter expression
Filter expression Filter expression
Filter expression
Ā 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
Ā 
Filter expression
Filter expression Filter expression
Filter expression
Ā 
Filter expression
Filter expressionFilter expression
Filter expression
Ā 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter 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
Ā 
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
Ā 
Filter expression in mule demo
Filter expression in mule demoFilter expression in mule demo
Filter expression in mule demo
Ā 
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
Ā 
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
Ā 
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
Ā 

More from Praneethchampion (15)

Mule execution
Mule executionMule execution
Mule execution
Ā 
Mule soa
Mule soaMule soa
Mule soa
Ā 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
Ā 
Mule security-jaas
Mule security-jaasMule security-jaas
Mule security-jaas
Ā 
Dataweave
Dataweave Dataweave
Dataweave
Ā 
Mule for each scope header collection
Mule for each scope header collectionMule for each scope header collection
Mule for each scope header collection
Ā 
Mmc
Mmc Mmc
Mmc
Ā 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
Ā 
Mule google connectors
Mule google connectorsMule google connectors
Mule google connectors
Ā 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
Ā 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
Ā 
Mule drools
Mule drools Mule drools
Mule drools
Ā 
Mule esb DataWeave
Mule esb DataWeaveMule esb DataWeave
Mule esb DataWeave
Ā 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
Ā 
Creating dynamic json in mule
Creating dynamic json in muleCreating dynamic json in mule
Creating dynamic json in mule
Ā 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(ā˜Žļø+971_581248768%)**%*]'#abortion pills for sale in dubai@
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Ā 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
Ā 

Recently uploaded (20)

Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Ā 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Ā 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Ā 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Ā 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
Ā 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Ā 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Ā 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
Ā 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
Ā 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Ā 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
Ā 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
Ā 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Ā 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Ā 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Ā 

How to use expression filter

  • 1. How to use Expression Filter
  • 2. Abstract ā€¢ The main motto of this PPT is how to use Expression filter in our applications.
  • 4. ā€¢ .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="expressionfilter" doc:name="HTTP"/> ā€¢ <message-properties-transformer scope="session" doc:name="Message Properties"> ā€¢ <add-message-property key="property1" value="mule studio"/> ā€¢ </message-properties-transformer> ā€¢ <logger message="--flow1--#[sessionVars['property1']]" level="INFO" doc:name="Logger"/> ā€¢ <expression-filter expression="#[sessionVars['property1']!='mule']" doc:name="Expression"/> ā€¢ <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"/> ā€¢ </flow> ā€¢ </mule>
  • 5. ā€¢ 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
  • 6. ā€¢ Flow of execution: 1. URL to trigger the service from browser http://localhost:8089/expressionfilter 2. session property is created using message property component In flow1 3. Service displays session properties in flow1 4. VM component in flow1 will call flow2 if the value of the session property is other then mule. 5. In the POC the session property value is ā€œmule studioā€ so flow1 calls flow2 and displays session property value in flow2