SlideShare uma empresa Scribd logo
1 de 27
Overview
Rule
 Rule engine introduction & Working
 Why use a Rule Engine?
 ReteOO
 Introduction to Drools
 Drools Expert & Drools Rule Formats
 Drools Rule Language Details
 Drools Eclipse IDE &
 Drools Guvnor Overview
 Drools Flow Overview
 Rule Bean
 Constraints for above rule
 Object type constraint - Applicant Object Type.
 Field constraints - age < 18
 An object type constraint plus its zero or more field
constraints is referred to as a pattern.
 The process of matching patterns against the inserted data
is, referred to as pattern matching.
rule "Is of valid age"
when
$a : Applicant( age < 18 ) 
Constraints
then
$a.setValid( false );
 Action
end
 The rule engine is the computer program that
delivers Knowledge Representation and
Reasoning(KRR) functionality to the
developer. At a high level it has three
components:
 Ontology (“Things” e.g java Classes/Beans )
 Rules
 Data
 Separates application from dynamic logic
 Rules can be modified by different groups
 No need to recompile or redeploy
 All rules are in one place
Declarative Programming
– Readable and Anyone can easily modify rules.
Centralization of Knowledge
- Repository of business policy
Speed and Scalability
- Rete algorithm, Leaps algorithm
 Rete algorithm was invented by Dr. Charles
Forgy.
 Rete algorithm can be broken into 2 parts:
rule compilation and runtime execution.
 Rule base is compiled into discrimination
network.
Discrimination network is used to filter data as it propagates
through the network.
 rule 1
 when
 Cheese( $cheddar : name == "cheddar" )
 $person : Person( favouriteCheese ==
$cheddar )
 then
 System.out.println( $person.getName() + "
likes cheddar" );
 end
 rule 2
 when
 Cheese( $cheddar : name == "cheddar" )
 $person : Person( favouriteCheese != $cheddar )
 then
 System.out.println( $person.getName() + " not likes cheddar" );
 end
 Drools introduces the Business Logic integration
Platform which provides a unified and integrated
platform for Rules, Workflow and Event
Processing
 Drools consist out of several projects:
Drools Expert (rule Engine)
Drools Guvnor (Business Rule Manager)
jBPM (Process/Workflow)
Drools Fusion (event processing /temporal reasoning)
Drools Planner (automated planning)
 Drools has an enhanced and optimized
implementation of the Rete algorithm for object
oriented systems called as ReteOO.
 Drools Expert is a declarative, rule based, coding
environment.
 Drools Rule Formats
 Drools Rule Language (DRL)
 Domain-specific language (DSL)
 Decision tables
 Guided rule editor
 XML
 DSL are written in natural language statements.
 Domain experts (such as business analysts) can validate and do changes as per
requirements.
 DSL definitions consists of transformations from DSL "sentences" to DRL
constructs.
 DRL
Cheese(age < 5, price == 20, type=="stilton", country=="ch")
 DSL
[when]There is a Cheese with=Cheese()
[when]- age is less than {age}=age<{age}
[when]- type is '{type}'=type=='{type}‘
[when]- country equal to '{country}'=country=='{country}'
 DSLR
There is a Cheese with
- age is less than 42
- type is 'stilton'
 DRL & DSL mapping
[when]Something is {colour}=Something(colour=="{colour}")
 Decision tables are a "precise yet compact"
(ref. Wikipedia) way of representing
conditional logic, and are well suited to
business level rules.
 spreadsheet format (XLS), and CSV.
 Decision tables are not recommended for
rules that do not follow a set of templates, or
where there are a small number of rules
 Each row in spreadsheet is a rule
 Decision tables are essentially a tool to
generate DRL rules automatically
 A Knowledge Base is what we call our collection of
compiled definitions, such as rules and processes,
which are compiled using the KnowledgeBuilder
KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
Add DRL file to Knowledge Builder , it parses and compiles DRL
files
knowledgeBuilder.add(drlFileAsResource, ResourceType.DRL);
Collection pkgs = knowledgeBuilder.getKnowledgePackages();
knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
knowledgeBase.addKnowledgePackages(pkgs);
 KnowledgeSession provides the way of
exposing objects to be ruled.
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
Applicant applicant = new Applicant( “Rajesh Kumar", 16 );
ksession.execute( applicant );
assertFalse( applicant.isValid() );
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
Applicant applicant = new Applicant( “Rajesh Kumar", 16 );
knowledgeSession.insert(applicant);
knowledgeSession.fireAllRules();
 Knowledge base can be updated inside rule’s body
insert()
 Inserted object will be used by rules engines inside current session
update()
 Updates existing in working memory object for the rest of rules
delete()
 Removed object will not be ruled on current execution
 The Eclipse based IDE provides users with an
environment to edit and test rules in various
formats, and integrate it deeply with their
applications.
 Required plugins
 GEF plugin , GEF is the Eclipse Graphical Editing Framework.

http://download.eclipse.org/tools/gef/updates/r
eleases/
 Drools Eclipse IDE plugin

http://download.jboss.org/drools/release/5.4.0.
Final/org.drools.updatesite/
 Go to windows preferences
 under the Drools category,
select "Installed Drools runtimes“
 use the default jar files as included in
the Drools Eclipse plugin
by clicking "Create a new Drools 5 runtime“
 Drools Homepage
 http://www.jboss.org/drools/
 Drools Blog
 http://blog.athico.com/
 Drools Chat
 irc.codehaus.org #drools
 Drools Mailing List
 rules-users@lists.jboss.org

Mais conteúdo relacionado

Mais procurados

Drools5 Community Training: Module 1.5 - Drools Expert First Example
Drools5 Community Training: Module 1.5 - Drools Expert First ExampleDrools5 Community Training: Module 1.5 - Drools Expert First Example
Drools5 Community Training: Module 1.5 - Drools Expert First ExampleMauricio (Salaboy) Salatino
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
Developing Complex Business Rules with Drools Integration
Developing Complex Business Rules with Drools IntegrationDeveloping Complex Business Rules with Drools Integration
Developing Complex Business Rules with Drools IntegrationBonitasoft
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 OverviewMark Proctor
 
Spring Framework - Data Access
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data AccessDzmitry Naskou
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaCharles Nutter
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Mark Proctor
 
Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)martincabrera
 
The Enterprise Case for Node.js
The Enterprise Case for Node.jsThe Enterprise Case for Node.js
The Enterprise Case for Node.jsNodejsFoundation
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Examplekamal kotecha
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation洪 鹏发
 
Drools Planner webinar (2011-06-15): Drools Planner optimizes automated planning
Drools Planner webinar (2011-06-15): Drools Planner optimizes automated planningDrools Planner webinar (2011-06-15): Drools Planner optimizes automated planning
Drools Planner webinar (2011-06-15): Drools Planner optimizes automated planningGeoffrey De Smet
 

Mais procurados (20)

Drools
DroolsDrools
Drools
 
Drools5 Community Training: Module 1.5 - Drools Expert First Example
Drools5 Community Training: Module 1.5 - Drools Expert First ExampleDrools5 Community Training: Module 1.5 - Drools Expert First Example
Drools5 Community Training: Module 1.5 - Drools Expert First Example
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Developing Complex Business Rules with Drools Integration
Developing Complex Business Rules with Drools IntegrationDeveloping Complex Business Rules with Drools Integration
Developing Complex Business Rules with Drools Integration
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 Overview
 
Spring Framework - Data Access
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data Access
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
 
GraalVm and Quarkus
GraalVm and QuarkusGraalVm and Quarkus
GraalVm and Quarkus
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)
 
The Enterprise Case for Node.js
The Enterprise Case for Node.jsThe Enterprise Case for Node.js
The Enterprise Case for Node.js
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
 
Drools Planner webinar (2011-06-15): Drools Planner optimizes automated planning
Drools Planner webinar (2011-06-15): Drools Planner optimizes automated planningDrools Planner webinar (2011-06-15): Drools Planner optimizes automated planning
Drools Planner webinar (2011-06-15): Drools Planner optimizes automated planning
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Lombok
LombokLombok
Lombok
 

Semelhante a Drools rule Concepts

Developing applications with rules, workflow and event processing (it@cork 2010)
Developing applications with rules, workflow and event processing (it@cork 2010)Developing applications with rules, workflow and event processing (it@cork 2010)
Developing applications with rules, workflow and event processing (it@cork 2010)Geoffrey De Smet
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital.AI
 
Being RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data PersistenceBeing RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data PersistenceDavid Hoerster
 
Optimizing Application Architecture (.NET/Java topics)
Optimizing Application Architecture (.NET/Java topics)Optimizing Application Architecture (.NET/Java topics)
Optimizing Application Architecture (.NET/Java topics)Ravi Okade
 
Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2MongoDB
 
Droolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingDroolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingSrinath Perera
 
Oleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoCOleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoCOleksandr Valetskyy
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaLucas Jellema
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020Thodoris Bais
 
GDSC Backend Bootcamp.pptx
GDSC Backend Bootcamp.pptxGDSC Backend Bootcamp.pptx
GDSC Backend Bootcamp.pptxSaaraBansode
 
Introduction to NoSQL Database
Introduction to NoSQL DatabaseIntroduction to NoSQL Database
Introduction to NoSQL DatabaseMohammad Alghanem
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info SheetMark Proctor
 
10 ways to make your code rock
10 ways to make your code rock10 ways to make your code rock
10 ways to make your code rockmartincronje
 
Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)David Groff
 
Integrating DROOLS With Mule ESB
Integrating DROOLS With Mule ESBIntegrating DROOLS With Mule ESB
Integrating DROOLS With Mule ESBJitendra Bafna
 

Semelhante a Drools rule Concepts (20)

JavaCro'14 - Drools Decision tables – form of human-readable rules – Dragan J...
JavaCro'14 - Drools Decision tables – form of human-readable rules – Dragan J...JavaCro'14 - Drools Decision tables – form of human-readable rules – Dragan J...
JavaCro'14 - Drools Decision tables – form of human-readable rules – Dragan J...
 
Developing applications with rules, workflow and event processing (it@cork 2010)
Developing applications with rules, workflow and event processing (it@cork 2010)Developing applications with rules, workflow and event processing (it@cork 2010)
Developing applications with rules, workflow and event processing (it@cork 2010)
 
Green dao
Green daoGreen dao
Green dao
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
 
Being RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data PersistenceBeing RDBMS Free -- Alternate Approaches to Data Persistence
Being RDBMS Free -- Alternate Approaches to Data Persistence
 
Schema webinar
Schema webinarSchema webinar
Schema webinar
 
Optimizing Application Architecture (.NET/Java topics)
Optimizing Application Architecture (.NET/Java topics)Optimizing Application Architecture (.NET/Java topics)
Optimizing Application Architecture (.NET/Java topics)
 
Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2Document Validation in MongoDB 3.2
Document Validation in MongoDB 3.2
 
Droolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 SrpingDroolsand Rule Based Systems 2008 Srping
Droolsand Rule Based Systems 2008 Srping
 
Oleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoCOleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoC
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas Jellema
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
 
GDSC Backend Bootcamp.pptx
GDSC Backend Bootcamp.pptxGDSC Backend Bootcamp.pptx
GDSC Backend Bootcamp.pptx
 
Introduction to NoSQL Database
Introduction to NoSQL DatabaseIntroduction to NoSQL Database
Introduction to NoSQL Database
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
 
Rules With Drools
Rules With DroolsRules With Drools
Rules With Drools
 
Rules with Drools
Rules with DroolsRules with Drools
Rules with Drools
 
10 ways to make your code rock
10 ways to make your code rock10 ways to make your code rock
10 ways to make your code rock
 
Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)Dynamic Object-Oriented Requirements System (DOORS)
Dynamic Object-Oriented Requirements System (DOORS)
 
Integrating DROOLS With Mule ESB
Integrating DROOLS With Mule ESBIntegrating DROOLS With Mule ESB
Integrating DROOLS With Mule ESB
 

Mais de RaviShankar Mishra

Token Management using Stormpath inside Mule
Token Management using Stormpath inside MuleToken Management using Stormpath inside Mule
Token Management using Stormpath inside MuleRaviShankar Mishra
 
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 esbRaviShankar Mishra
 
Creating restful api using mule esb
Creating restful api using mule esbCreating restful api using mule esb
Creating restful api using mule esbRaviShankar Mishra
 
Connecting to salesforce and using database in mule
Connecting to salesforce and using database in muleConnecting to salesforce and using database in mule
Connecting to salesforce and using database in muleRaviShankar Mishra
 

Mais de RaviShankar Mishra (7)

Mulesoft meetup 29.06
Mulesoft meetup 29.06Mulesoft meetup 29.06
Mulesoft meetup 29.06
 
Hyderbad meetup 19th jan
Hyderbad meetup 19th janHyderbad meetup 19th jan
Hyderbad meetup 19th jan
 
Token Management using Stormpath inside Mule
Token Management using Stormpath inside MuleToken Management using Stormpath inside Mule
Token Management using Stormpath inside 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
 
Data weave in Mule
Data weave in MuleData weave in Mule
Data weave in Mule
 
Creating restful api using mule esb
Creating restful api using mule esbCreating restful api using mule esb
Creating restful api using mule esb
 
Connecting to salesforce and using database in mule
Connecting to salesforce and using database in muleConnecting to salesforce and using database in mule
Connecting to salesforce and using database in mule
 

Último

Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 

Último (20)

Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 

Drools rule Concepts

  • 1.
  • 2. Overview Rule  Rule engine introduction & Working  Why use a Rule Engine?  ReteOO  Introduction to Drools  Drools Expert & Drools Rule Formats  Drools Rule Language Details  Drools Eclipse IDE &  Drools Guvnor Overview  Drools Flow Overview
  • 3.  Rule Bean  Constraints for above rule  Object type constraint - Applicant Object Type.  Field constraints - age < 18  An object type constraint plus its zero or more field constraints is referred to as a pattern.  The process of matching patterns against the inserted data is, referred to as pattern matching. rule "Is of valid age" when $a : Applicant( age < 18 )  Constraints then $a.setValid( false );  Action end
  • 4.  The rule engine is the computer program that delivers Knowledge Representation and Reasoning(KRR) functionality to the developer. At a high level it has three components:  Ontology (“Things” e.g java Classes/Beans )  Rules  Data
  • 5.
  • 6.  Separates application from dynamic logic  Rules can be modified by different groups  No need to recompile or redeploy  All rules are in one place Declarative Programming – Readable and Anyone can easily modify rules. Centralization of Knowledge - Repository of business policy Speed and Scalability - Rete algorithm, Leaps algorithm
  • 7.  Rete algorithm was invented by Dr. Charles Forgy.  Rete algorithm can be broken into 2 parts: rule compilation and runtime execution.  Rule base is compiled into discrimination network.
  • 8. Discrimination network is used to filter data as it propagates through the network.
  • 9.  rule 1  when  Cheese( $cheddar : name == "cheddar" )  $person : Person( favouriteCheese == $cheddar )  then  System.out.println( $person.getName() + " likes cheddar" );  end
  • 10.  rule 2  when  Cheese( $cheddar : name == "cheddar" )  $person : Person( favouriteCheese != $cheddar )  then  System.out.println( $person.getName() + " not likes cheddar" );  end
  • 11.  Drools introduces the Business Logic integration Platform which provides a unified and integrated platform for Rules, Workflow and Event Processing  Drools consist out of several projects: Drools Expert (rule Engine) Drools Guvnor (Business Rule Manager) jBPM (Process/Workflow) Drools Fusion (event processing /temporal reasoning) Drools Planner (automated planning)
  • 12.  Drools has an enhanced and optimized implementation of the Rete algorithm for object oriented systems called as ReteOO.  Drools Expert is a declarative, rule based, coding environment.  Drools Rule Formats  Drools Rule Language (DRL)  Domain-specific language (DSL)  Decision tables  Guided rule editor  XML
  • 13.
  • 14.  DSL are written in natural language statements.  Domain experts (such as business analysts) can validate and do changes as per requirements.  DSL definitions consists of transformations from DSL "sentences" to DRL constructs.  DRL Cheese(age < 5, price == 20, type=="stilton", country=="ch")  DSL [when]There is a Cheese with=Cheese() [when]- age is less than {age}=age<{age} [when]- type is '{type}'=type=='{type}‘ [when]- country equal to '{country}'=country=='{country}'  DSLR There is a Cheese with - age is less than 42 - type is 'stilton'  DRL & DSL mapping [when]Something is {colour}=Something(colour=="{colour}")
  • 15.
  • 16.
  • 17.  Decision tables are a "precise yet compact" (ref. Wikipedia) way of representing conditional logic, and are well suited to business level rules.  spreadsheet format (XLS), and CSV.  Decision tables are not recommended for rules that do not follow a set of templates, or where there are a small number of rules  Each row in spreadsheet is a rule  Decision tables are essentially a tool to generate DRL rules automatically
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.  A Knowledge Base is what we call our collection of compiled definitions, such as rules and processes, which are compiled using the KnowledgeBuilder KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); Add DRL file to Knowledge Builder , it parses and compiles DRL files knowledgeBuilder.add(drlFileAsResource, ResourceType.DRL); Collection pkgs = knowledgeBuilder.getKnowledgePackages(); knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase(); knowledgeBase.addKnowledgePackages(pkgs);
  • 23.  KnowledgeSession provides the way of exposing objects to be ruled. StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession(); Applicant applicant = new Applicant( “Rajesh Kumar", 16 ); ksession.execute( applicant ); assertFalse( applicant.isValid() ); StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession(); Applicant applicant = new Applicant( “Rajesh Kumar", 16 ); knowledgeSession.insert(applicant); knowledgeSession.fireAllRules();
  • 24.  Knowledge base can be updated inside rule’s body insert()  Inserted object will be used by rules engines inside current session update()  Updates existing in working memory object for the rest of rules delete()  Removed object will not be ruled on current execution
  • 25.  The Eclipse based IDE provides users with an environment to edit and test rules in various formats, and integrate it deeply with their applications.  Required plugins  GEF plugin , GEF is the Eclipse Graphical Editing Framework.  http://download.eclipse.org/tools/gef/updates/r eleases/  Drools Eclipse IDE plugin  http://download.jboss.org/drools/release/5.4.0. Final/org.drools.updatesite/
  • 26.  Go to windows preferences  under the Drools category, select "Installed Drools runtimes“  use the default jar files as included in the Drools Eclipse plugin by clicking "Create a new Drools 5 runtime“
  • 27.  Drools Homepage  http://www.jboss.org/drools/  Drools Blog  http://blog.athico.com/  Drools Chat  irc.codehaus.org #drools  Drools Mailing List  rules-users@lists.jboss.org