Rulebase Technology

6
1 Copyright © 2008 BIZRULES Rulebase Technology Rolando Hernandez Enterprise Rules Architect CEO, BIZRULES [email protected] www.BizRules.com www.VisibleKnowledge.com

description

On Declarative vs. procedural programming, and the Rete algorithm. (note: Download the file and start Powerpoint slide show to see animatons and high quality graphics; the slideshare viewer messes up some of the graphics)

Transcript of Rulebase Technology

Page 1: Rulebase Technology

1Copyright © 2008 BIZRULES

Rulebase Technology

Rolando HernandezEnterprise Rules Architect

CEO, [email protected]

www.BizRules.comwww.VisibleKnowledge.com

Page 2: Rulebase Technology

2Copyright © 2008 BIZRULES

Traditional applicationsusing hard-coded rules

Client Applications 1st

Tier

Database 2nd Tier

Code Business Rules Data

Rule Engine 3rd TierClient

Applications 1st Tier

Modern applicationsusing business rules

Page 3: Rulebase Technology

3Copyright © 2008 BIZRULES

Traditional Procedural Language

R1: IF a is true THEN b is true

R10: IF y is true THEN z is true

R100: IF x is true THEN y is true

R1000: IF z is true THEN “APPROVE”

R10,000: IF d is true THEN “DENY”

Traditional Procedural language is sequential, forward only

Once you get an answer, the rest of the rules fire anyway

You have to loop a few times to get around sequence problem

Suppose your rules are out of order? Problems arise if sequence is incorrect

What if you have to add a new rule? Developer has to figure out what order

to put it in Adding a new rule could break existing

rules

Loop #1 Ran 10,000 rules1 rule fired(R100)

Loop #2 Ran 10,000 rules2 rules fired(R10, R1000)

TotalRan 20,000 rules3 rules fired

CONCLUSION: Approve

DATA: X is TRUE

Page 4: Rulebase Technology

4Copyright © 2008 BIZRULES

Declarative (Rule-based) Language

R1: IF a is true THEN b is true

R10: IF y is true THEN z

is true

R100: IF x is true THEN

y is true

R1000: IF z is true THEN

“APPROVE”

R10,000: IF d is true THEN

“DENY”

Rules are in no particular order

Cycle #1Ran 2 rulesFired 1 rule(R100)

Cycle #2Ran 1 ruleFired 1 rule (R10)

Cycle #3Ran 1 ruleFired 1 rule (R1000)

TotalRan 4 rulesFired 3 rules

CONCLUSION: APPROVE

Search for rules that match the data R100: IF z is true THEN “APPROVE”Execute those rules R100 fires because z is true

DATA: X is TRUE Y is TRUE Z is true

Search for rules that match the data R10: IF y is true THEN zExecute those rules R10 fires because Y is true

DATA: X is TRUE Y is TRUE

Search for rules that match the data R50: IF x is false THEN “Deny” R100: IF x is true THEN y is TrueExecute those rules R50 does not fire R100 fires because x is true

DATA: X is TRUEDATA: X is TRUE

Page 5: Rulebase Technology

5Copyright © 2008 BIZRULES

Rulebases are the next step in application development productivity

Operating Environment

Operating Environment

Operating Environment

Database EngineDatabase EngineApplications

Rules EngineApplications

Applications

DATA

EmergingCurrentClassic

CODERULES

CODERULES

CODE

RULES

DATA DATA

Page 6: Rulebase Technology

6Copyright © 2008 BIZRULES

Why this is important

Rules steer business decisions Rulebases store and share rules Rule engines drive business strategy