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

PPTX
How to use or filter
PPTX
How to use not filter
PPTX
PPTX
PPTX
PPTX
Wildcard Filter
PPTX
How to use file component
PPTX
File component in mule
How to use or filter
How to use not filter
Wildcard Filter
How to use file component
File component in mule

What's hot (13)

PPTX
How to use message properties component
PPTX
PPTX
Expression filter in Mule
PPTX
File component
PPTX
PPTX
PPTX
Specifying a default exception strategy
PPTX
Collection aggregator
PPTX
Validate json schema
PPTX
Reference exception strategy
PPTX
Property place holder
PPTX
Mule property placeholder
PPTX
Message properties component in mule demo
How to use message properties component
Expression filter in Mule
File component
Specifying a default exception strategy
Collection aggregator
Validate json schema
Reference exception strategy
Property place holder
Mule property placeholder
Message properties component in mule demo
Ad

Viewers also liked (13)

PDF
SegarAnakan_EIS_011014-Reduced
DOC
resume 2015
DOCX
PPT
NFPtweetup Critiquing Twitter Voice Disney
PPTX
4 popular uncommon home utility gifts
PPTX
PDF
AML 2015
DOCX
Elyse Sydney Kaysha This Is My Penis After All Fall 2015
PPTX
Global warming
DOCX
Kromatografi kolom (resin penukar ion)
PPTX
Photoshoot scheduling
DOCX
Kromatografi lapis tipis (klt)
PPTX
Connecting generations through walking
SegarAnakan_EIS_011014-Reduced
resume 2015
NFPtweetup Critiquing Twitter Voice Disney
4 popular uncommon home utility gifts
AML 2015
Elyse Sydney Kaysha This Is My Penis After All Fall 2015
Global warming
Kromatografi kolom (resin penukar ion)
Photoshoot scheduling
Kromatografi lapis tipis (klt)
Connecting generations through walking
Ad

Similar to How to use and filter (20)

PPTX
How to use expression filter
PPTX
How to use expression filter
PPTX
How to use expression filter
PPTX
How to use expression filter
PPTX
Mule- File component example
PPTX
How to use message properties component
PPTX
How to use message properties component
PPTX
How to use message properties component
PPTX
Message properties component in Mule
PPTX
Filter expression
 
PPTX
Filter expression in mule
PPTX
Filter expression in mule
PPTX
Filter expression
PPTX
Filter expression
PPTX
File component
 
PPTX
File component
PPTX
Mule File component
PPTX
File component in mule
PPTX
Expression Filters
PPTX
How to use wildcard filter
How to use expression filter
How to use expression filter
How to use expression filter
How to use expression filter
Mule- File component example
How to use message properties component
How to use message properties component
How to use message properties component
Message properties component in Mule
Filter expression
 
Filter expression in mule
Filter expression in mule
Filter expression
Filter expression
File component
 
File component
Mule File component
File component in mule
Expression Filters
How to use wildcard filter

More from RaviRajuRamaKrishna (10)

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

Recently uploaded (20)

PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Institutional Correction lecture only . . .
PDF
Computing-Curriculum for Schools in Ghana
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
RMMM.pdf make it easy to upload and study
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Lesson notes of climatology university.
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Sports Quiz easy sports quiz sports quiz
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Institutional Correction lecture only . . .
Computing-Curriculum for Schools in Ghana
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
human mycosis Human fungal infections are called human mycosis..pptx
O7-L3 Supply Chain Operations - ICLT Program
01-Introduction-to-Information-Management.pdf
Renaissance Architecture: A Journey from Faith to Humanism
VCE English Exam - Section C Student Revision Booklet
RMMM.pdf make it easy to upload and study
PPH.pptx obstetrics and gynecology in nursing
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Lesson notes of climatology university.

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.