building, deploying, and orchestrating complex decision...

40
Building, Deploying, and Orchestrating Complex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO www.OpenRules.com October 22, 2020 at 2:00 PST

Upload: others

Post on 02-Jan-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

Building, Deploying, and Orchestrating

Complex Decision Services

Jacob Feldman, PhDOpenRules Inc., CTO

www.OpenRules.com

October 22, 2020 at 2:00 PST

Page 2: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

2OpenRules, Inc.

Building Complex Operational Decision Services

This presentation is about building Operational Decision Services for different business domains

o Not little pilots or demos but real Maintainable Decision Services o Created, tested, and deployed on cloud by Business Analysts

We will use the main DMN Standard sample to build a library of Decision Models and Services for the Loan Origination domain

Here is our implementation plan:1. Instead of developing a large (monolithic!) decision model, we will create a library of

small reusable decision models

2. We will test each model separately

3. We will use these small models as “Lego Boxes” to create larger Decision Services and deploy them as cloud microservices

4. We will create a top-level Loan Origination Service by orchestrating smaller decision services

Page 3: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

3

How can Subject Mater Experts build Libraries of Operational Decision Models/Services?

Operational Decision Services

Operational Decision Services

Library of Decision Models and Services

(On-cloud or On-prem)

In two steps:

Decision Models Decision ServicesDeploy

STEP 1. Creating and

Testing Business Decision

Models

STEP 2. Deploying and

Orchestrating Operational

Decision Services

Externalized

Business

Logic

Decision-Making Applications

Decision

Data

Business

Logic

Page 4: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

4

From Business Decision Models to Operational Decision Services

Business

Goal 2 (Decision Model)

Business

Goal 3 (Decision Model)

Business

Goal 1 (Decision Model)

Business Goal N Orchestration

Decision Model

Business

Goal 4 (Decision Model)

Business

Goal 5 (Decision Model)

Excel

One-Click

Business

Decision

Models

Operational

Decision

Services

Deploy

Knowledge/Rules Repository

Decision

Microservice

Decision

Microservice

Decision

Microservice

Common Business

Glossary

Library of Domain-Specific Decision Models

Loosely-Coupled Decision Services

Page 5: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

5

Business Process

Pre-Bureau processing

Post-Bureau processing

DMN Loan Origination Example

Page 6: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

6

Example: DMN Loan Origination

Decision Requirements Diagram (DMN DRD)

Page 7: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

7

Example: DMN Loan Origination

The above diagram with all decision variables and relationships between them is “messy” and difficult to comprehend

We will apply the Goal-Oriented Decision Modeling Approach by selecting major goals and sub-goals, defining their internal logic using business rules, and letting a OpenRules Decision Manager to figure out all relationships and build the diagrams automatically

Page 8: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

8

Example: DMN Loan Origination

Business analysts identify 3 Main Goals:

These goals have common and specialized sub-goals like Affordability and Risk Category

Loan Origination Result(ACCEPT/DECLINE)

Bureau Strategy(BUREAU/DECLINE/THROUGH)

Routing(ACCEPT/DECLINE/REFER)

Pre-Bureau Processing Post-Bureau Processing

Page 9: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

9

Decision Goals => Separate Decision Models

Loan Origination Result(ACCEPT/DECLINE)

Bureau Strategy(BUREAU/DECLINE/THROUGH)

Affordability

Pre-Bureau(TRUE/FALSE)

Risk Category

Pre-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Routing(DECLINE/REFER/ACCEPT)

Affordability

Post-Bureau(TRUE/FALSE)

Risk Category

Post-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Glossary

Pre-Bureau Processing Post-Bureau Processing

Page 10: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

10OpenRules, Inc.

Let’s start with an example of a complete executable decision model

A simple decision model “Application Risk Score”

We will use only Excel and File Manager:

Rules.xls: Glossary.xls:

Page 11: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

11OpenRules, Inc.

Decision Model “ApplicationRiskScore”:

Test Cases

Page 12: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

12OpenRules, Inc.

Demo

Let’s build and test this decision model from File Manager

Page 13: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

13OpenRules, Inc.

Decision Model: Execution Results

Build the Decision Model and Execute Test Cases (click on “test.bat”)

Execution Results:

Page 14: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

14

How is Rules Repository organized?

One main folder “RulesRepository”

Every decision model has a separate sub-folder

The sub-folder “Common” keeps the Common Glossary in the file “Common/Glossary.xls”

Each decision model has the file “DecisionModel.xls” with the table “Environment” that describes its structure

Lets’ look at the Repository from a File Manager

Page 15: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

15

Rules Repository with multiple inter-connected decision models

Page 16: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

16

Decision Models “RiskCategoryPreBureau” / “RiskCategoryPostBureau”

Loan Origination Result(ACCEPT/DECLINE)

Bureau Strategy(BUREAU/DECLINE/THROUGH)

Affordability

Pre-Bureau(TRUE/FALSE)

Risk Category

Pre-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Routing(DECLINE/REFER/ACCEPT)

Affordability

Post-Bureau(TRUE/FALSE)

Risk Category

Post-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Glossary

Pre-Bureau Processing Post-Bureau Processing

Page 17: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

17OpenRules, Inc.

Risk Category

Risk Category (Pre-Bureau)

Risk Category (Post-Bureau)

The Variable Names are the

same, the logic is different!

We’ll create two decision models

Page 18: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

18

Decision Model “RiskCategoryPreBureau”

Determines the goal “Risk Category” for pre-bureau processing

Rules.xls: Glossary is extended by:

- Existing Customer (Applicant)

- Risk Category (Application)

Page 19: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

19

Decision Model “RiskCategoryPostBureau”

Determines the goal “Risk Category” for post-bureau processing

Rules.xls:

Glossary is extended by: - Existing Credit Score - New Business Concept “BureauData”

Decision tables “RiskCategoryPreBureau” and “RiskCategoryPostBureau” share the same “Risk Category” calculated differently

So, they cannot be used inside the same decision model

Page 20: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

20

Assembling Decision Models like LEGO-boxes

Decision Model “RiskCategoryPreBureau”

Decision Model “ApplicationRiskScore”

Decision Model “RiskCategoryPostBureau”

Page 21: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

21

Decision Models “AffordabilityPreBureau” / “AffordabilityPostBureau”

Loan Origination Result(ACCEPT/DECLINE)

Bureau Strategy(BUREAU/DECLINE/THROUGH)

Affordability

Pre-Bureau(TRUE/FALSE)

Risk Category

Pre-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Routing(DECLINE/REFER/ACCEPT)

Affordability

Post-Bureau(TRUE/FALSE)

Risk Category

Post-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Glossary

Pre-Bureau Processing Post-Bureau Processing

Page 22: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

22

Common Decision Rules for “Affordability”

Rules.xls:

We will be in trouble if

we try to manually

define all inter-table

relationships even

using friendly diagrams.

Rule engine should

figure them out

automatically!

We need two Decision Models:

- AffordabilityPreBureau

- AffordabilityPostBureau

- Same rules but different Environment tables

Page 23: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

23

Decision Models for “Affordability”

We will place the above rules in the file “Affordability/Rules.xls”

We will create two folders “AffordabilityPreBureau” and “AffordabilityPostBureau” with different Environment tables:

Page 24: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

24

Decision Model “BureauStrategy”

Loan Origination Result(ACCEPT/DECLINE)

Bureau Strategy(BUREAU/DECLINE/THROUGH)

Affordability

Pre-Bureau(TRUE/FALSE)

Risk Category

Pre-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Routing(DECLINE/REFER/ACCEPT)

Affordability

Post-Bureau(TRUE/FALSE)

Risk Category

Post-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Glossary

Pre-Bureau Processing Post-Bureau Processing

Page 25: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

25

Decision Model “BureauStrategy”

Determines the goal “Bureau Strategy” for pre-bureau processing

Rules.xls:

Page 26: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

26

Execution path:- ApplicationRiskScore

- PreBureauRiskCategory

- PMT

- RequiredMonthlyInstallment

- DisposableIncome

- CreditContingencyFactor

- Affordability

- Eligibility

- BureauCallType

- BureauStrategy

Decision Model “BureauStrategy” – Decision Requirement Diagram

Here is an automatically generated DRD and Execution Path:

Page 27: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

27

BureauStrategy

Execution Results

Page 28: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

28

Decision Model “Routing”

Loan Origination Result(ACCEPT/DECLINE)

Bureau Strategy(BUREAU/DECLINE/THROUGH)

Affordability

Pre-Bureau(TRUE/FALSE)

Risk Category

Pre-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Routing(DECLINE/REFER/ACCEPT)

Affordability

Post-Bureau(TRUE/FALSE)

Risk Category

Post-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Glossary

Pre-Bureau Processing Post-Bureau Processing

Page 29: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

29

Decision Model “Routing”

Determines the goal “Routing” for post-bureau processing

Rules.xls:

Page 30: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

30

Decision Model “Routing” – Decision Requirement Diagram

Here is an automatically generated DRD and Execution Path:

Execution path:- ApplicationRiskScore

- PostBureauRiskCategory

- PMT

- RequiredMonthlyInstallment

- DisposableIncome

- CreditContingencyFactor

- Affordability

- Routing

Page 31: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

31

Decision Model “Routing”

Execution Results

Page 32: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

32

Common Glossary

Glossary.xls

Page 33: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

33

Deployment and Orchestration of Decision Services

Loan Origination Result(ACCEPT/DECLINE)

Bureau Strategy(BUREAU/DECLINE/THROUGH)

Routing(DECLINE/REFER/ACCEPT)

We cannot assemble decision model for “Loan Origination Result” using include-statements inside Environment table because decision models BureauStrategy and Routing share the same variables “Risk Category” and “Affordability”

But we can invoke them as independent Decision Services, e.g. deployed as AWS Lambda functions

Page 34: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

34

Deploying Decision Models

Develop Decision Model Deploy as Service Execute

Page 35: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

35

Decision Models => Decision Microservices

OpenRules supports one-click deployment of decision models on cloud as AWS Lambda functions

Deploy: click on the standard file “deployLambda.bat”

Test: click on the automatically generated “testLambda.bat”

We deploy two main AWS lambda functions:

BureauStrategy

Routing

Test deployed decision services

Now we are ready to orchestrate them

Page 36: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

36

Orchestration Decision Model “Loan Origination Result”

Loan Origination Result(ACCEPT/DECLINE)

Bureau Strategy(BUREAU/DECLINE/THROUGH)

Affordability

Pre-Bureau(TRUE/FALSE)

Risk Category

Pre-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Routing(DECLINE/REFER/ACCEPT)

Affordability

Post-Bureau(TRUE/FALSE)

Risk Category

Post-Bureau (DECLINE/HIGH/MEDIUM/LOW/VERY LOW)

Application Risk Score (0-900)

Glossary

Pre-Bureau Processing Post-Bureau Processing

Page 37: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

37

Orchestration Logic is Business Logic!

ActionExecute can execute

- internal decision tables or

- external decision services (!)

We will build the Orchestration Decision Model “Result”

Page 38: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

38

Test and Deploy the final decision model “Result”

We can test decision model “Result” by a click on “test.bat”:

Now we can also deploy and test the top-level decision model “Loan Origination Result” as an AWS Lambda function

Page 39: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

39

Summary: We’ve created a Library of executable Decision Models and Decision Microservices (without programming)

Business

Goal 2 (Decision Model)

Business

Goal 3 (Decision Model)

Business

Goal 1 (Decision Model)

Main Business Goal Orchestration Decision

Model

Business

Goal 4 (Decision Model)

Business

Goal 5 (Decision Model)

Excel

One-Click

Business

Decision

Models

Operational

Decision

Services

Deployment

Knowledge/Rules Repository

Decision

Microservice

Decision

Microservice

Decision

Microservice

Common Business

Glossary

Library of Domain-Specific Decision Models

Loosely-Coupled Decision Services

Page 40: Building, Deploying, and Orchestrating Complex Decision ...openrules.com/pdf/JacobFeldman.BBC2020.pdfComplex Decision Services Jacob Feldman, PhD OpenRules Inc., CTO October 22, 2020

40OpenRules, Inc.

QnA

[email protected]

[email protected]

+1 732 993 3131

www.OpenRules.com