drools presentation for tallink.ee
DESCRIPTION
TRANSCRIPT
![Page 1: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/1.jpg)
Anton Arhipov
http://arhipov.blogspot.com
![Page 2: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/2.jpg)
INTRODUCTION
Rule Engine
BRMS
![Page 3: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/3.jpg)
Rule Engine
A business rules engine is a software system that executes one or more business rules in a runtime production environment. - Wikipedia
![Page 4: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/4.jpg)
Advantages
• Declarative programming– Rule engines allow you to say "What to do" not "How to do it".
• Logic and data separation– Your data is in your domain objects, the logic is in the rules.
• Centralization of knowledge– By using rules, you create a repository of knowledge which is executable.
• Explanation facility– Rule systems effectively provide an "explanation facility" by being able to
log the decisions made by the rule engine along with why the decisions were made.
• Understandable rules– By creating object models and, optionally, Domain Specific Languages
that model your problem domain you can set yourself up to write rules that are very close to natural language.
![Page 5: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/5.jpg)
When to use Rule Engine?
The general answer is: "when there is no satisfactory traditional programming approach to solve the problem"
• The problem is just too fiddle for traditional code. • The problem is beyond any obvious algorithm based solution. • The logic changes often • Domain experts are readily available, but are nontechnical.
If rules are a new technology for your project teams, the overhead in getting going must be factored in.
![Page 6: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/6.jpg)
When NOT to use Rule Engine?
… in the excitement of working with rules engines, that people forget that a rules engine is only one
piece of a complex application or solution.
If you just need to bypass the release process, think twice before using the rule engine.
It works best if you can write
the rules in declarative manner
![Page 7: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/7.jpg)
BRMS
A BRMS or Business Rule Management System is a software system used to manage the variety and complexity of decision logic (a.k.a business rules) that is used by operational systems within an
organization or enterprise. - Wikipedia
• Features:– A repository, allowing decision logic to be externalized
from core application code – Tools, allowing both technical developers and
business experts to define and manage decision logic – A runtime environment, allowing applications to
invoke decision logic managed within the BRMS and execute it using a business rule engine
![Page 8: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/8.jpg)
Why do you need BRMS at all?
• Flexibility– Alter the system behavior in production
• Separation of concern– A good practice in software engineering, everything is
separated. Keep rules out of the application.
• Centralized rules repository – The dream of every IT organization.
• Business teams closer to implementation– The business analyst can view and play with rules
that effect business and hence get very close to the implementation.
![Page 9: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/9.jpg)
Emmmm……
![Page 10: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/10.jpg)
![Page 11: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/11.jpg)
http://www.jboss.org/drools
![Page 12: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/12.jpg)
http://blog.athico.com
![Page 13: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/13.jpg)
irc.codehaus.org #drools
![Page 14: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/14.jpg)
InfoWorld BOSSIE Awards 2008
![Page 15: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/15.jpg)
![Page 16: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/16.jpg)
![Page 17: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/17.jpg)
Authoring
• Involves the creation of DRL or XML files for rules which are fed into a parser.
• Package builder also undertakes any code generation and compilation
• A package is self contained and deployable, in that it's a serialized object consisting of one or more rules.
![Page 18: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/18.jpg)
The Rule
![Page 19: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/19.jpg)
Runtime
• A RuleBase is a runtime component which consists of one or more packages.
• A RuleBase can instantiate one or more WorkingMemories.
![Page 20: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/20.jpg)
The API
![Page 21: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/21.jpg)
Deployment
![Page 22: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/22.jpg)
DEMO
![Page 23: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/23.jpg)
Questions yet?
![Page 24: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/24.jpg)
![Page 25: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/25.jpg)
Drools Flow
A workflow engine combining processes and rules
A workflow is a process that describes the order in which series of steps need to be executed,
using a flow chart.
![Page 26: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/26.jpg)
Evaluating a set of rules in your process
The rules that need to be evaluated should be grouped in a ruleflow group (using the ruleflow-group rule attribute)
and a RuleSet node can be used to trigger the evaluation of these rules in your process.
![Page 27: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/27.jpg)
Rules + Processes
A workflow engine combining processes and tools
• Why rules in processes?– Simplicity: Complex decisions are usually easier to specify
using a set of rules. – Agility: Rules and processes can have a separate life cycle. – Different scope: Rules can be reused accross processes or
outside processes. – Declarative: Focus on describing 'what' instead of 'how'. – Granularity: It is easy to write simple rules that handle specific
circumstances. Processes more suited to describe the overall control flow.
– Performance: No unnecessary passing, transformation or synchronization of data.
![Page 28: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/28.jpg)
The API
![Page 29: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/29.jpg)
DEMO
![Page 30: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/30.jpg)
Question yet again??
![Page 31: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/31.jpg)
![Page 32: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/32.jpg)
Guided Editing
![Page 33: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/33.jpg)
Guided Editing
![Page 34: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/34.jpg)
Guided Editing
![Page 35: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/35.jpg)
Decision Tables
![Page 36: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/36.jpg)
QA
![Page 37: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/37.jpg)
QA
![Page 38: Drools Presentation for Tallink.ee](https://reader034.vdocuments.mx/reader034/viewer/2022051514/54c0e5d64a79596a498b457e/html5/thumbnails/38.jpg)
What’s next?