SlideShare a Scribd company logo
How to use And Filter
12-12-2014
Abstract
• The main motto of this PPT is How to use And
Filter in our applications.
Introduction
• Mule bundles more than a dozen Filters that
determine whether a message can proceed
through an application flow. The simplest
filters implement basic logic operators (such
as and, or, and not), but these simple
elements can be combined in various ways to
specify complex logical conditions.
Example
.mflow
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" 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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<flow name="AndFilterFlow1" doc:name="AndFilterFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8089" path="andfilter"
doc:name="HTTP"/>
<logger message="--entered into the flow" level="INFO" doc:name="Logger"/>
<set-payload value="&lt;Soap-Env&gt;&lt;Body&gt;&lt;Path&gt;mulesoft&lt;/Path&gt;&lt;/Body&gt;&lt;/Soap-
Env&gt;" doc:name="Set Payload"/>
<and-filter doc:name="And">
<expression-filter expression="#[xpath('/Soap-Env/Body/Path/text()').text.contains('mule')]"/>
<expression-filter expression="#[xpath('/Soap-Env/Body/Path/text()').text.contains('soft')]"/>
</and-filter>
<logger message="--Success" level="INFO" doc:name="Logger"/>
</flow>
</mule>
• Output:
INFO 2015-12-12 06:49:37,897 [main] org.mule.DefaultMuleContext:
**********************************************************************
* Application: AndFilter *
* OS encoding: Cp1252, Mule encoding: UTF-8 *
* *
* Agents Running: *
* Clustering Agent *
* JMX Agent *
**********************************************************************
INFO 2015-12-12 06:49:37,898 [main]
org.mule.module.launcher.MuleDeploymentService:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'AndFilter' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2015-12-12 06:49:41,558 [[AndFilter].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: --entered into the flow
INFO 2015-12-12 06:49:42,214 [[AndFilter].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: --Success
• Flow of execution:
1. URL to trigger the service from browser
http://localhost:8089/andfilter
2. AND filter checks whether the request
contains ‘mule’ and ‘soft’ or not?, if yes, it will
print a message ‘Success’, else it will not go
further.
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.7/filters

More Related Content

What's hot (13)

PPTX
How to use message properties component
mdfkhan625
 
PPTX
Data Mapper
sivachandra mandalapu
 
PPTX
Expression filter in Mule
Mohammed246
 
PPTX
File component
Durga Prasad Kakarla
 
PPTX
Validation
sivachandra mandalapu
 
PPTX
Splitter
sivachandra mandalapu
 
PPTX
Specifying a default exception strategy
sivachandra mandalapu
 
PPTX
Collection aggregator
sivachandra mandalapu
 
PPTX
Validate json schema
sivachandra mandalapu
 
PPTX
Reference exception strategy
sivachandra mandalapu
 
PPTX
Property place holder
sivachandra mandalapu
 
PPTX
Mule property placeholder
Sashidhar Rao GDS
 
PPTX
Message properties component in mule demo
Sudha Ch
 
How to use message properties component
mdfkhan625
 
Expression filter in Mule
Mohammed246
 
File component
Durga Prasad Kakarla
 
Specifying a default exception strategy
sivachandra mandalapu
 
Collection aggregator
sivachandra mandalapu
 
Validate json schema
sivachandra mandalapu
 
Reference exception strategy
sivachandra mandalapu
 
Property place holder
sivachandra mandalapu
 
Mule property placeholder
Sashidhar Rao GDS
 
Message properties component in mule demo
Sudha Ch
 

Viewers also liked (13)

PDF
SegarAnakan_EIS_011014-Reduced
Mark Pillsworth
 
DOC
resume 2015
Mitchelle Suarez
 
DOCX
Destilasi
UIN Alauddin Makassar
 
PPT
NFPtweetup Critiquing Twitter Voice Disney
NFPtweetup
 
PPTX
4 popular uncommon home utility gifts
Jason's Gizmoly Hub
 
PPTX
Age Awareness
Generations Working Together
 
PDF
AML 2015
Petar Dimitrov
 
DOCX
Elyse Sydney Kaysha This Is My Penis After All Fall 2015
Sydney Finchum
 
PPTX
Global warming
ivid1990
 
DOCX
Kromatografi kolom (resin penukar ion)
UIN Alauddin Makassar
 
PPTX
Photoshoot scheduling
azizamrobinsonmedia
 
DOCX
Kromatografi lapis tipis (klt)
UIN Alauddin Makassar
 
PPTX
Connecting generations through walking
Alison Clyde
 
SegarAnakan_EIS_011014-Reduced
Mark Pillsworth
 
resume 2015
Mitchelle Suarez
 
NFPtweetup Critiquing Twitter Voice Disney
NFPtweetup
 
4 popular uncommon home utility gifts
Jason's Gizmoly Hub
 
AML 2015
Petar Dimitrov
 
Elyse Sydney Kaysha This Is My Penis After All Fall 2015
Sydney Finchum
 
Global warming
ivid1990
 
Kromatografi kolom (resin penukar ion)
UIN Alauddin Makassar
 
Photoshoot scheduling
azizamrobinsonmedia
 
Kromatografi lapis tipis (klt)
UIN Alauddin Makassar
 
Connecting generations through walking
Alison Clyde
 
Ad

Similar to How to use and filter (20)

PPTX
How to use expression filter
RaviRajuRamaKrishna
 
PPTX
Mule filters
Son Nguyen
 
PPTX
How to use wildcard filter
RaviRajuRamaKrishna
 
PPTX
Expression
sivachandra mandalapu
 
PPTX
Expression Filters
Durga Prasad Kakarla
 
PPTX
How to use expression filter
irfan1008
 
PPTX
How to use expression filter
Praneethchampion
 
PPTX
How to use expression filter
mdfkhan625
 
PPTX
How to use expression filter
princeirfancivil
 
PPTX
How to use expression filter
Phaniu
 
PPTX
How to use expression filter
Sunil Komarapu
 
PPTX
How to use expression filter
Anand kalla
 
PPTX
How to use expression filter
Khasim Saheb
 
PPTX
Filter expression in mule demo
Sudha Ch
 
PPTX
Mule filters
sathyaraj Anand
 
PPTX
Mule ESB Tutorial Part 2
Srikanth N
 
PPTX
Filter expression in mule
Rajkattamuri
 
PPTX
Filter expression
AbdulImrankhan7
 
PPTX
Filter expression
Sunil Komarapu
 
PPTX
Filter expression in mule
javeed_mhd
 
How to use expression filter
RaviRajuRamaKrishna
 
Mule filters
Son Nguyen
 
How to use wildcard filter
RaviRajuRamaKrishna
 
Expression Filters
Durga Prasad Kakarla
 
How to use expression filter
irfan1008
 
How to use expression filter
Praneethchampion
 
How to use expression filter
mdfkhan625
 
How to use expression filter
princeirfancivil
 
How to use expression filter
Phaniu
 
How to use expression filter
Sunil Komarapu
 
How to use expression filter
Anand kalla
 
How to use expression filter
Khasim Saheb
 
Filter expression in mule demo
Sudha Ch
 
Mule filters
sathyaraj Anand
 
Mule ESB Tutorial Part 2
Srikanth N
 
Filter expression in mule
Rajkattamuri
 
Filter expression
AbdulImrankhan7
 
Filter expression
Sunil Komarapu
 
Filter expression in mule
javeed_mhd
 
Ad

More from RaviRajuRamaKrishna (10)

PPTX
Mock component in munit
RaviRajuRamaKrishna
 
PPTX
Jms selector
RaviRajuRamaKrishna
 
PPTX
Sftplite
RaviRajuRamaKrishna
 
PPTX
Object store
RaviRajuRamaKrishna
 
PPTX
How to use splitter component
RaviRajuRamaKrishna
 
PPTX
How to use rest component
RaviRajuRamaKrishna
 
PPTX
How to use soap component
RaviRajuRamaKrishna
 
PPTX
How to use salesforce cloud connector
RaviRajuRamaKrishna
 
PPTX
How to use data mapper transformer
RaviRajuRamaKrishna
 
PPTX
How to use bean as datasource in database connector
RaviRajuRamaKrishna
 
Mock component in munit
RaviRajuRamaKrishna
 
Jms selector
RaviRajuRamaKrishna
 
Object store
RaviRajuRamaKrishna
 
How to use splitter component
RaviRajuRamaKrishna
 
How to use rest component
RaviRajuRamaKrishna
 
How to use soap component
RaviRajuRamaKrishna
 
How to use salesforce cloud connector
RaviRajuRamaKrishna
 
How to use data mapper transformer
RaviRajuRamaKrishna
 
How to use bean as datasource in database connector
RaviRajuRamaKrishna
 

Recently uploaded (20)

PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PDF
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPTX
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPTX
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
Mathematics 5 - Time Measurement: Time Zone
menchreo
 

How to use and filter

  • 1. How to use And Filter 12-12-2014
  • 2. Abstract • The main motto of this PPT is How to use And Filter in our applications.
  • 3. Introduction • Mule bundles more than a dozen Filters that determine whether a message can proceed through an application flow. The simplest filters implement basic logic operators (such as and, or, and not), but these simple elements can be combined in various ways to specify complex logical conditions.
  • 5. .mflow <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" 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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> <flow name="AndFilterFlow1" doc:name="AndFilterFlow1"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8089" path="andfilter" doc:name="HTTP"/> <logger message="--entered into the flow" level="INFO" doc:name="Logger"/> <set-payload value="&lt;Soap-Env&gt;&lt;Body&gt;&lt;Path&gt;mulesoft&lt;/Path&gt;&lt;/Body&gt;&lt;/Soap- Env&gt;" doc:name="Set Payload"/> <and-filter doc:name="And"> <expression-filter expression="#[xpath('/Soap-Env/Body/Path/text()').text.contains('mule')]"/> <expression-filter expression="#[xpath('/Soap-Env/Body/Path/text()').text.contains('soft')]"/> </and-filter> <logger message="--Success" level="INFO" doc:name="Logger"/> </flow> </mule>
  • 6. • Output: INFO 2015-12-12 06:49:37,897 [main] org.mule.DefaultMuleContext: ********************************************************************** * Application: AndFilter * * OS encoding: Cp1252, Mule encoding: UTF-8 * * * * Agents Running: * * Clustering Agent * * JMX Agent * ********************************************************************** INFO 2015-12-12 06:49:37,898 [main] org.mule.module.launcher.MuleDeploymentService: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Started app 'AndFilter' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ INFO 2015-12-12 06:49:41,558 [[AndFilter].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: --entered into the flow INFO 2015-12-12 06:49:42,214 [[AndFilter].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: --Success
  • 7. • Flow of execution: 1. URL to trigger the service from browser http://localhost:8089/andfilter 2. AND filter checks whether the request contains ‘mule’ and ‘soft’ or not?, if yes, it will print a message ‘Success’, else it will not go further.