Wednesday, December 2, 2015

business rule management system (BRMS)

Fact

Facts are the knowledge of DROOLS. Facts are plain old java objects (POJO) where data for rules are stored.

Working Memory

Facts are placed in working memory which will be used for pattern matching at later stage. A user can retrieve, insert or modify facts. 

Rule

Rules are a piece code which contain business logic's 

Rule Engine

A business rules engine is a software system. Rule engine executes multiple business rules in a production environment. Rule engine have a Inference Engine,production and working memory. Businesses rule are put into  production memory. Facts (Data) is placed in working memory. Inference engine matches facts against each rule in the production memory. Inference Engine uses Linear, Rete, Treat or Leaps algorithm for pattern matching. DROOLS uses extended Rete Algorithm, ReteOO for pattern matching. When many rules becomes true for same fact, it creates conflict. Agenda uses Conflict Resolution strategy to manage the execution. Rule engine architecture is as shown below

Rule Engine
Advantages of drools are
  • Logic and data separation
  • Declarative programming
  • Centralization of knowledge
  • Understandable rules
One of the most common questions which comes to the mind of an architect/developer is when to use drools. DROOLS should be used when there is an often change in business logic, problem is beyond any obvious algorithm based solution, problem is just too fiddle for traditional code and when we have nontechnical Domain experts. 

DROOLS Expert

Drools Expert is split into run time and authoring . Authoring involves creation of DROOL file (DRL/XML). Rulebase is the run time component of DROOLS which consists of many packages. Rulebase is used to instantiate working memories.

DROOLS Guvnor

Guvnor is a web based utility used to edit and mange drools. We should use guvnor when multiple user need to edit rules or when we need have a version management for rules. Guvnor is used by Business Analyst, Rule expert and  Developer.

DROOLS Flow

DROOLS Flow is used to integrate process and rules. Users can create work flows using this utility. In a work flow we can configure the order in which different tasks/rules need to be executed.

No comments: