Agenda
What is a Business Rule?
“A statement that defines or constrains some aspect of the business which is intended to assert business structure or to control or influence the behavior or the business” (Business Rules Group)
“Business rules or business rulesets describe the operations, definitions and constraints that apply to an organization in achieving its goals.” (Wikipedia)
“A formal and implementable expression of some user requirement”
“The practices, processes, and policies by which an organization conducts its business”
Types of Rules
What is a Business Rules Engine?
Rule Builder/Editor
(Tools for developing and debugging rules)
Rule Deployment and Configuration (Tools for deploying and managing rules)
Rules Engine
Rules Engine
Rules Engine
Business
System
Business
System
Business
System
Shared�Rules
Repository
Traditional Approach to Business Rules
The traditional (ad hoc) approach of dealing with rule changes leads to…
Issues
Where Business Rules Typically Exist
Applications
Processes
People
Documents
Moving to a BRMS
Where Business Rules Typically Exist
Applications
Processes
People
Documents
Business Rule Management System
Rules are Defined, Analyzed and Maintained
User Tools
Rules are Stored and Shared
Rule Repository
Rules are Deployed, Executed and Monitored
Rule Server
Benefits of the Business Rule Approach
What does it enable?
What is the value?
BRMS
Syntax of a Business Rule
Rule Engine Basics
Set of Facts (Working Memory /DB)
THEN [Claim] is Approved
IF [Diagnosis] is Covered && [Claim.Cost] < $250
THEN [Claim] is Approved
IF [Customer] is Preferred && [Order.Cost] < $250
THEN [Order] is Approved
Rule-Base
Acme places Order 101 for $175
Acme is a preferred Customer
Inference
Engine
Acme Order 101 is Approved
Result:
Types of Facts
There two general types of facts:
In most cases, a database will likely be the source for the non-volatile facts, whereas a transaction application will be providing the volatile data that requires processing.
Relationship between Services
This illustration depicts the relationship between the rules engine, exposed as a “decision service”, and the BRMS.
The BRMS is the interface by which the rules can be managed and maintained.
Use Cases for Rules Engine
The list likely goes on –numbering in the thousands…
Business Rules & Your Enterprise
Choosing a BRMS
Op
Open Source
*Now Oracle Policy Automation
How do I Choose?
JBoss Drools
Drools & jBPM
Drools & jBPM are now tightly integrated. The implication of this is that decision points within your business process models can driven by your business rules.
Integrating Drools
Jboss Drools now includes an integration framework using Apache Camel.
Camel is a lightweight Enterprise Service Bus that allows Drools to be exposed as a services API (i.e., “Decision Service”). This makes it easy to call Drools form a variety of clients using nearly any programming language.
BRMS Roadmap for Your Enterprise
Identify Use Case
Select a target application for the first implementation. For example, a new web application.
Harvest Business Rules
Identify all business rules used by the application. If necessary, remove them from PL/SQL code etc.
Populate BRMS
Add the identified rules in the BRMS. Create procedures to populate working memory.
Create Decision Service
Publish the rules as an API using a decision service. Use the rules in the new application.
Rather than attempt to build a comprehensive collection of all business rules, instead build incrementally. This reduces risk
and builds organizational
familiarity.
Dissecting a Drool Business Rule
rule "ZipMissing"
dialect "mvel"
when
$request : ValidateClaimForAuthorization( propertyZipCode == "" )
then
System.out.println("Invalid Request - ZipCode is missing.");
result.setResultCode(102);
result.setResultDesc(Constant.ERROR102);
end
An “object type” restraint.
public class ValidateClaimForAuthorization {
private int vendorSiteId;
private String jobNumber;
private String propertyZipCode;
private int workAsgnGenSeq;
private String operationSource;
public String getPropertyZipCode() {
return propertyZipCode;
}
public void setPropertyZipCode(String propertyZipCode) {
this.propertyZipCode = propertyZipCode;
}
A “field/method type” restraint.
What’s Next
Sources