38
Anton Arhipov [email protected] http://arhipov.blogspo t.com

Drools Presentation for Tallink.ee

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Drools Presentation for Tallink.ee

Anton Arhipov

[email protected]

http://arhipov.blogspot.com

Page 2: Drools Presentation for Tallink.ee

INTRODUCTION

Rule Engine

BRMS

Page 3: Drools Presentation for Tallink.ee

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

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

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

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

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

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

Emmmm……

Page 10: Drools Presentation for Tallink.ee
Page 11: Drools Presentation for Tallink.ee

http://www.jboss.org/drools

Page 12: Drools Presentation for Tallink.ee

http://blog.athico.com

Page 13: Drools Presentation for Tallink.ee

irc.codehaus.org #drools

Page 14: Drools Presentation for Tallink.ee

InfoWorld BOSSIE Awards 2008

Page 15: Drools Presentation for Tallink.ee
Page 16: Drools Presentation for Tallink.ee
Page 17: Drools Presentation for Tallink.ee

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

The Rule

Page 19: Drools Presentation for Tallink.ee

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

The API

Page 21: Drools Presentation for Tallink.ee

Deployment

Page 22: Drools Presentation for Tallink.ee

DEMO

Page 23: Drools Presentation for Tallink.ee

Questions yet?

Page 24: Drools Presentation for Tallink.ee
Page 25: Drools Presentation for Tallink.ee

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

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

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

The API

Page 29: Drools Presentation for Tallink.ee

DEMO

Page 30: Drools Presentation for Tallink.ee

Question yet again??

Page 31: Drools Presentation for Tallink.ee
Page 32: Drools Presentation for Tallink.ee

Guided Editing

Page 33: Drools Presentation for Tallink.ee

Guided Editing

Page 34: Drools Presentation for Tallink.ee

Guided Editing

Page 35: Drools Presentation for Tallink.ee

Decision Tables

Page 36: Drools Presentation for Tallink.ee

QA

Page 37: Drools Presentation for Tallink.ee

QA

Page 38: Drools Presentation for Tallink.ee

What’s next?