39
Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

  • View
    220

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

Building the Kuali Student BRMS(Business Rules Management System)

Cathy Dew & Leo Fernig

Kuali Days :: Chicago May 13-14, 2008

Page 2: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

2Kuali Days :: Chicago May 13-14

Agenda

1. Harvesting and Structuring Rules (Cathy) Industry Best Thinking and Practices Kuali Student Analysis

2. Setting Up the Technical BRMS Environment (Leo) KS Business Rules Environment Work to Date

3. Integrating the BRMS and SOA (Cathy) The Rule Entity Model Fitting It All Together

Page 3: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

3Kuali Days :: Chicago May 13-14

Getting to Functional Business Rules

RESEARCHTheory

ConceptsBest Practices

DATA COLLECTIONPartner Institutions

Focus on Learning Unit Service Modeling

Use Case Collection

Data ConceptsTerminology &

Definitions

Classification & Categorization

Strawman BRMS Strategy

Service Definitions

Actors & Scenarios

Entity Diagrams &

Message Structures

Page 4: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

4Kuali Days :: Chicago May 13-14

Essential Reading

Business Rules and Information Systems: Aligning IT with Business Goal -- Tony Morgan

The Business Rule Book: Classifying, Defining and Modeling Rules -- Ronald G. Ross

Business Rules Management and Service Oriented Architecture: A Pattern Language -- Ian Graham

Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML -- Jim Arlow and Ila Neustadt

Principles of the Business Rules Approach -- Ronald G. Ross

Smart (Enough) Systems -- James Taylor and Neil Raden

What Not How: The Business Rules Approach to Application Development -- C. J. Date

Business Rules Applied: Building Better Systems Using the Business Rules Approach -- Barbara von Halle

Page 5: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

5Kuali Days :: Chicago May 13-14

Everyone Agrees

A business rule should define what should be the case

It should not prescribe :: Who invokes the rule (use case) When the rule is executed (business

event or process description) Where the rule executes (design) How the rule is to be implemented

(design)

In fact, Kuali Student has to do all of this as part of the BRMS

Page 6: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

6Kuali Days :: Chicago May 13-14

Ross “RuleSpeak” Templates

A Sentence Pattern is a basic structure (Template) used to express a Rule in a consistent, well-organized manner

Every rule has a functional category :: Rejector – a constraint, any rule that disallows an event Producer – neither rejects for projects, simply computes Projector – stimulus/response rule, causes some new event

Some Rejector Rules A non-major student must have permission from instructor A pre-registration slate must not contain more than 20 credit hours A student may enroll only if the student is in good standing

Page 7: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

7Kuali Days :: Chicago May 13-14

Rulespeak Terminology

Establish the anchor of the rule The thing being constrained Rule must have one and only one anchor

Establish the correspondent(s) of the rule, a.k.a. facts The thing doing the constraining Rule must have at least one correspondent

With agreed upon terms and definitions, we could start to analyze business logic and discover rules.

Page 8: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

8Kuali Days :: Chicago May 13-14

Discovering Rules

Page 9: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

9Kuali Days :: Chicago May 13-14

Collecting Examples

Academic Evaluation

Admissions

Transfer Articulation

Degree Composition

Grades, GPA, etc.

Enrollment

Transfer Credit Articulation

Page 10: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

10Kuali Days :: Chicago May 13-14

Focus on Enrollment Rules

Description Rule Facts

General Eligibility

Page 11: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

11Kuali Days :: Chicago May 13-14

Focus on Enrollment Rules

Course Prereq / Coreq Facts

FSU

Rule

Page 12: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

12Kuali Days :: Chicago May 13-14

Focus on Enrollment Rules

Course Prereq / Coreq Facts

MITRule

Page 13: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

13Kuali Days :: Chicago May 13-14

Focus on Enrollment Rules

Course Prereq / Coreq Facts

UBC

Rule

Page 14: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

14Kuali Days :: Chicago May 13-14

Patterns Start to Emerge

Count (set of courses, criteria) >= numeric value Credits Courses Subjects Unit Hours

Grade/GPA (criteria) >= numeric value Course grade GPA for term, for year, overall, within major

Student is/is not value Status is eligible, no holds, has permission Admitted to institution, college, major

Page 15: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

15Kuali Days :: Chicago May 13-14

Ownership vs. Execution

Ownership of rules is a function of the process (and people) responsible for authoring, maintaining and publishing a set of rules

Execution of rules is the process responsible for executing a rule may be different from the processes responsible for creating/authoring the rule.

Scheduling Rules, e.g., course has 200 seats Owned by Central Scheduling Office Created during the process of scheduling Executed during registration

Page 16: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

The Technical BRMS Environment

Page 17: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

17Kuali Days :: Chicago May 13-14

KS Business Rules Environment

A Business Rules Management Service (BRMS)

A Rules Engine (Drools was selected for KS)

Business Rules User Interfaces  (that allow business analysts to create and modify business rules)

Business services that execute rules Placing the rules execution inside the service that needs it.

The enrolment service would execute pre-requisite rules, degree rules etc The student financial service would execute fee calculation rules

Business Rules Data Warehouse Rules are extracted from the BRMS (using the standard BRMS service definitions)

and loaded into the data warehouse. Business Intelligence tools (such as Jasper) can be used to write reports against this data warehouse.

Workflow Business Rules that are managed in the BRMS can be moved through workflow

processes for various levels of approval, just like any other object.

Page 18: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

18Kuali Days :: Chicago May 13-14

Data Warehouse

Business ServiceBusiness Service

Rules User

Interface

Drools

Executable Rules

Rule Execution Engine

BRMS

Rules Metadata

Rules

Business Service

KS Business Rules Environment

Metadata is used to produce the user’s palette to create and edit rules

Rules are created, saved and updated through the user interface

Rule data extracted to data warehouse

Get AgendaExecute Rules

Exported to executable format

Page 19: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

19Kuali Days :: Chicago May 13-14

Data Warehouse

Business ServiceBusiness Service

Rules User

Interface

Drools

Executable Rules

Rule Execution Engine

BRMS

Rules Metadata

Rules

Business Service

Phase 1

Aug – Dec 2007 Selection of Rules Engine Technology

Page 20: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

20Kuali Days :: Chicago May 13-14

Data Warehouse

Business ServiceBusiness Service

Rules User

Interface

Drools

Executable Rules

Rule Execution Engine

BRMS

Rules Metadata

Rules

Business Service

Phase 2

Jan – May 2008 1) Creation of BRMS2) BRMS_Drools

interface

Page 21: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

21Kuali Days :: Chicago May 13-14

Data Warehouse

Business ServiceBusiness Service

Rules User

Interface

Drools

Executable Rules

Rule Execution Engine

BRMS

Rules Metadata

Rules

Business Service

Phase 3

May – June 2008 Integration of BRMSand service stack

Page 22: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

22Kuali Days :: Chicago May 13-14

Data Warehouse

Business ServiceBusiness Service

Rules User

Interface

Drools

Executable Rules

Rule Execution Engine

BRMS

Rules Metadata

Rules

Business Service

Phase 4

Development of User Interfaces

Page 23: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

23Kuali Days :: Chicago May 13-14

A rule consists of a condition and action(s)

When

proposition 1 and proposition 2

Then

action 1

A Business Rule

Condition

Action

Page 24: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

24Kuali Days :: Chicago May 13-14

Example rule:

Total credits > 30 andgrade point average > 3.5

A Business Rule

Right Hand

Side

Left Hand

Side

Comparison

Operator

Boolean

Operator

Proposition

Page 25: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

25Kuali Days :: Chicago May 13-14

UML for a Business Rule

Page 26: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

26Kuali Days :: Chicago May 13-14

How do we get rules into the system?The Rules User Interface

There are 3 stereotypical ways of presenting rules:

1. A decision table

2. A flowchart

3. A procedural rule (if…then…)

Page 27: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

27Kuali Days :: Chicago May 13-14

Visual Stereotype #1: Decision Table

Program Visa statusCost per credit

Arts Canadian 200

Arts Student visa, Visitor 400

Science, Applied Science Canadian 300

Science, Applied Science Student visa, Visitor 600

ProgramMin credits

Max credits Visa status

Cost per credit

Arts 0 15 Canadian 50

Arts 0 15 Student visa, Visitor 100

Arts 15 30 Canadian 75

Arts 15 30 Student visa, Visitor 200

Science, Applied Science 0 30 Canadian 300

Science, Applied Science 0 30 Student visa, Visitor 400

This is not a look-up table. Not only can you change data but you can change the structure of the table without any programming changes. For example, two new columns can be added with no changes to the code:

Page 28: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

28Kuali Days :: Chicago May 13-14

Visual Stereotype #3: Flowchart

Apply Evaluation

Rule

Are thegrades

complete?

Is the result

a “PASS”?

Create Registration

Record

Yes

YesNo

No

Page 29: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

29Kuali Days :: Chicago May 13-14

Visual Stereotype #3: Procedural Rule

Pre-requisites for CHEM 415

Both courses CHEM120, CHEM130AND

ORTotal credits >12

1 course CHEM 230AND

Average >80%

Page 30: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

30Kuali Days :: Chicago May 13-14

Example of a User Interface

Page 31: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

31Kuali Days :: Chicago May 13-14

Rules and Business Intelligence

Traditionally Business Intelligence only deals with “facts” in the Enterprise Systems. Now we can apply Business Intelligence to business rules.

For example: Is there any correlation between student success and pre-requisite

rules? Which courses are referenced most frequently in curriculum rules? Are there any rules that inhibit student success (in the sense of

causing students to take more than 4 years to finish their program)?

Page 32: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

32Kuali Days :: Chicago May 13-14

Data Warehouse

Business ServiceBusiness Service

Rules User

Interface

Drools

Executable Rules

Rule Execution Engine

BRMS

Rules Metadata

Rules

Business Service

How does a business services “know” which rules to invoke?

Page 33: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

Integrating the BRMS and SOA

Page 34: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

34Kuali Days :: Chicago May 13-14

Rules Entity Diagram

1. Agenda Determination Structure :: information needed to determine the specific Agenda

2. Agenda :: set of Business Rules that apply to a business process needing a decision

3. Output :: for each Agenda, the expected output

4. Business Rule :: individual business rule

5. Anchor :: for each Rule, the entity type instance to which the rule is attached

6. Fact :: data (facts) needed to execute the rule

Agenda

Agenda Determination

Structure

Output

Business Rule

Fact

Anchor

Page 35: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

35Kuali Days :: Chicago May 13-14

Agenda Determination Decision Table

TypeRelation State

Agenda Name Agenda Description >> Rules Output

course enrolled/ registered

Student Enrolls in Course

•enrollment reqs (student, admitted, no holds) •academic reqts (min GPA, good standing) •course reqts (pre/co/anti-reqs, w/grade) •program reqts (GPA, major match) • financial reqts (enr fees paid, lui fees paid)

OK / Not OK with Explanation

course planned Student Plans Course

•course reqts (pre/co/anti-reqs, w/grade)•program reqts (GPA, major match)

Status and Recommendations

Page 36: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

36Kuali Days :: Chicago May 13-14

Academic Record

Example Business Rule

1. Agenda Determination :: Validate relationship of type Enroll for Course

2. Agenda :: Student Enrolls in MATH 301

3. Output :: OK / Not OK

4. Business Rule :: Student has met pre-reqs of 2 of (static list) 6 credits of (dynamic list) overall GPA >= 3.0

5. Anchor :: MATH 301

6. Facts :: course sets (static and dynamic), student’s academic record

Student Enrolls in MATH 301

Validate Relationship

Enroll in Course

OK / Not OK

Met MATH 301 Prerequisites

200-level MATH

courses

MATH 101, MATH 102, MATH 103

MATH 301

Page 37: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

37Kuali Days :: Chicago May 13-14

Fitting It Together KS BRMS

Harvested a bunch of rules

Developed a strategy for collecting and classifying rules

Agreed on terminology and a business rule entity model

Completed a Proof of Concept for a representative pre-requisite rule Built the Core BRMS Defined and stored a business rule Translated it to a Drools Executed the rule from our Enrollment business service

Page 38: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

38Kuali Days :: Chicago May 13-14

Fitting It Together KS BRMS

We are in the process of modeling :: How a business process determines which

rules to execute What is the link to the Agenda Smallest footprint possible

Who is responsible for getting the facts needed to execute the rule Without violating SOA (who knows what) Without requiring BRMS to know about domains

Page 39: Building the Kuali Student BRMS (Business Rules Management System) Cathy Dew & Leo Fernig Kuali Days :: Chicago May 13-14, 2008

39Kuali Days :: Chicago May 13-14

Thank You

Coming Soon, to a university near you...