Corticon Rule Modeling Challenge Jan 2018 Order Promotions

Similar documents
Rule Modeling Challenge Collections Mike Parish

The Corticon Rule Modeling Methodology. A Case Study. Mortgage Approval

Set Up a Federated Result Source for SharePoint 2013 By Jacqueline Mulcahy

The Corticon Rule Modeling Methodology. Applied to. FEMA Disaster Assistance Fraud Detection. A Case Study

Claims Central. Promotion and Program Claims Users Guide

6 Stephanie Well. It s six, because there s six towers.

Last time: Saw how to implement atomicity in the presence of crashes, but only one transaction running at a time

5 R1 The one green in the same place so either of these could be green.

Decision Management Community

Label Program Printing Shelf Labels

In this exercise you will practice some more SQL queries. First let s practice queries on a single table.

DSWR User Guide. In effect from January 29 th,, BCLDB Direct Sales Web Reporting User Guide Page 1

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Week 02 Module 06 Lecture - 14 Merge Sort: Analysis

Reference: W3School -

Learning About Relational Database By using Microsoft Access 2010

Experimenting with bags (tables and query answers with duplicate rows):

Fyndiq WooCommerce Plugin. User Guide Version 1.0.0

Loan Origination Rule Modeling Challenge (June 2017) Corticon Solution

Divisibility Rules and Their Explanations

(Refer Slide Time: 01:25)

24 Sub-Queries. Sub-Queries

Introduction to Access 97/2000

Rule Modeling Case Study Generic Diabetic Monitoring. Mike Parish

This module presents the star schema, an alternative to 3NF schemas intended for analytical databases.

MA 1128: Lecture 02 1/22/2018

ICT IGCSE Databases (Access) A database is a collection of data or information stored in a logical format.

Manage Duplicate Records in Salesforce PREVIEW

Claims Central. Promotion and Program Claims Users Guide

CSCI 201 Lab #11 Prof. Jeffrey Miller 1/23. Lab #11 CSCI 201. Title MySQL Installation. Lecture Topics Emphasized Databases

12. MS Access Tables, Relationships, and Queries

Microsoft Access Relationship Total Queries - Reports

WEEK 3 TERADATA EXERCISES GUIDE

Practical 2: Using Minitab (not assessed, for practice only!)

Deal Registration. The process you need to follow u

ICT IGCSE Databases (Access)

This document provides an overview of the enhancements and support issue fixes in this Minfos release.

Basic Reliable Transport Protocols

Universal Printer Plug-in

Chapter. Storeroom Module. Table of Contents

3. Getting data out: database queries. Querying

SedonaOffice Users Conference. San Francisco, CA January 21 24, Query Builders. Presented by: Matt Howe

Combinatorics Prof. Dr. L. Sunil Chandran Department of Computer Science and Automation Indian Institute of Science, Bangalore

Mn/DOT Market Research Reporting General Guidelines for Qualitative and Quantitative Market Research Reports Revised: August 2, 2011

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Third-Party Website. Table of Contents

What s New Guide Merchants

Updated: 31 st October 2017 CONTENT CREATION

Formal Definition of Computation. Formal Definition of Computation p.1/28

Applied Information and Communication Technology

Repetition Through Recursion

iquote User Guide 01 August 2018

DO EVEN MORE WITH TABLEAU. At BlueGranite, our unique approach and extensive expertise helps you get the most from your Tableau products.

2. QuickBooks Desktop Integration User Guides

Section 4 General Factorial Tutorials

Exercise #6: Sales by Item Year over Year Report

Online Demo Guide. Barracuda PST Enterprise. Introduction (Start of Demo) Logging into the PST Enterprise

Strategy. 1. You must do an internal needs analysis before looking at software or creating an ITT

Using Microsoft Access

Lesson 14 Transcript: Triggers

AUTO PARTSBRIDGE Dealer User Guide

PNSQC Tuesday, October 9, 2012

Hints for Organizers of a Scientific Conference by Reinhard Krause Rehberg (August 2008)

MIS 0855 Data Science (Section 006) Fall 2017 In-Class Exercise (Day 18) Finding Bad Data in Excel

Increasing Conversions with Retargeting s and Website Personalization Quick and Easy Ideas to Implement before the Holidays

Lecture 2: Modeling Introduction

When Company or Business Unit Row Security Isn t Enough

Introduction to Domain Testing

Search Screen. To search for a model click search at the top.

Getting Started. In this chapter, you will learn: 2.1 Introduction

Step 1: Create a totals query to show the total cost price and total sale price of the wine for each supplier.

chapter 12 C ONTROLLING THE LEVEL OF

Reseller Incentive Terms and Conditions

Asking for information (with three complex questions, so four main paragraphs)

Creating a Spreadsheet by Using Excel

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Programming in C++ Indian Institute of Technology, Kharagpur

2.3 Algorithms Using Map-Reduce

the NXT-G programming environment

When using computers, it should have a minimum number of easily identifiable states.

(Refer Slide Time 6:48)

Workshop. Import Workshop

How metadata can reduce query and report complexity As printed in the September 2009 edition of the IBM Systems Magazine

Access Review. 4. Save the table by clicking the Save icon in the Quick Access Toolbar or by pulling

CIS Component-Based Software Design BAPTISM BY FIRE AN INTRODUCTION TO COURSE ESSENTIALS. Suggestions on the Design of Your Game of Nim Project

Dynamics 365 for Customer Service - User's Guide

VLOOKUP Hacks. 5 Ways to Get More Use from VLOOKUP Excel University ALL RIGHTS RESERVED

Using Photoshop Actions in Batches

Premium POS Pizza Order Entry Module. Introduction and Tutorial

Proofwriting Checklist

OVERVIEW OF RELATIONAL DATABASES: KEYS

Grade 6 Math Circles November 6 & Relations, Functions, and Morphisms

06/12/2017 Blackbaud Altru 4.96 Memberships US 2017 Blackbaud, Inc. This publication, or any part thereof, may not be reproduced or transmitted in

Access Basics: When and How

2. Use elementary row operations to rewrite the augmented matrix in a simpler form (i.e., one whose solutions are easy to find).

Chapter11 practice file folder. For more information, see Download the practice files in this book s Introduction.

Linksys Stackable Switches

PROGRAMMING. We create identity

Hewlett Packard Enterprise Smart Quote

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 24 Solid Modelling

As your databases continue to evolve, you will need to incorporate advanced queries and reports. This chapter addresses how to create and use action

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex

Transcription:

Corticon Rule Modeling Challenge Jan 2018 Order Promotions Mike Parish The Problem The objective of this challenge is to help merchants to define various promotions for their sales orders and to automatically decide if an order is eligible for a promotion. An order usually consists of order items with known price and quantities. A promotion defines minimal quantities of certain items in the eligible orders. A simple example of promotion: reduce the total cost of the order by $3.50 if it contains at least 5 items 1108 and at least 4 item 2639. The Approach Usually the first step in solving any kind of business rule problem is to clearly identify all of the business objects involved, their attributes and their relationships to one another. This is true regardless of which rule engine you may choose to implement the rules. It s also true even if you will be using any other tools. For this problem we might have a data model something like this Customer -name -type -status -customer 1 -orders * -id -date Order -order 1 -items * -sku -qty -price -total Item A general approach to a problem like this might be For each promotion 1. Determine if the customer is eligible to participate (based on customer type, status etc) 2. Determine which orders are eligible (based on order date etc) 3. Determine which items are eligible (based on sku, qty etc) 4. Determine discounts and rebates 5. Compute the totals Each promotion would then be represented as a set of decision tables that go through each of these five steps.

Corticon Solution The objects, attributes and relationships would look like this in Corticon. Customers can have many orders; Orders can have many items. Incidentally, if you already have a UML diagram or database tables then you can create the Corticon vocabulary automatically. We will probably find, as we develop the rule model, that more attributes need to be added to keep track of intermediate results. For example totals. A high level flow might look like this where each little box represents a different promotion. We could keep them all in a single decision like this or we could split them into separate decisions. This would depend on whether there were any dependencies between the promotions. Maybe if you get the New Customer promotion you can t also get the Winter 2017 promotion. The New Year Promotion is grey because it s not yet active.

Let s take a look at the rule reduce the total cost of the order by $3.50 if it contains at least 5 items 1108 and at least 4 item 2639. Let s suppose 1108 is coffee and 2639 is tea. Then a simple rule sheet might look like this: The scope says for each order belonging to each customer, consider coffee items and tea items The filters define the two types of item we are interested (by sku) and then we can use more meaningful names (coffee, tea) in the rules. But will this always work? We are assuming that there is just one item for coffee and one item for tea in the order. What if there were six separate items for coffee each with quantity 1? Then the rules above wouldn t work. Fortunately there is a simple solution using the sum operator: This pattern can easily be extended to other combinations of quantity: In this case the discounts are cumulative since if you fire rule 2, rule 1 will also fire. If you don t want cumulative discounts then you could represent it like this by specifying the applicable ranges more precisely.

But remember that, since we defined the scope like this, the discount only applies to coffee and tea items WITHIN the SAME order. Not on different orders. If we needed the quantities to be on different orders then we d do something along these lines: First we modify the scope to create aliases to two different orders And then we might apportion the $3.50 discount to each order as follows: Most promotions have a start date and end date and this is easily handled by adding an appropriate filter to the scope section so that only orders within the range get processed by the rules: If we further wanted to restrict the promotion to a particular customer type (say Retail) we simply add another filter: To restrict to Online orders:

For the rest of this discussion let s assume that each order does not have duplicate skus. We can easily arrange for this by using the logic described in an earlier challenge dealing with finding duplicates. (https://dmcommunity.org/challenge/challenge-august-2015/ ) In a traditional rule sheet that does not use the filter mechanism you would need to put all these conditions in the body of the rule sheet; and although a bit cumbersome this will work just fine. But as you can see the highlighted conditions have the same values for every rule and so are more simply expressed using the filter mechanism. It s also more efficient to use filters since only the data that gets through the filter is processed by the rules. Without the filter, the same data is evaluated once per rule. The more rules in the decision table, the more efficient it is to use a filter instead. The filters become even more powerful if the data is actually coming from a database since the rule sheet can use the filters to automatically create a SQL query to retrieve only the records that meet the filter criteria. Side note: the decision table above is not complete can you see where it still has holes?

Corticon can automatically determine that we have not provided discounts in the following cases After talking with our business users we might determine that discounts for these situations are as follows: Note that in rule 8 we can explicitly identify when they receive no discount. This enables us to generate a useful message that tells exactly why they got no discount. In fact as a general best practise, every rule should have an associated message that describes the intent and outcome of the rule in business friendly terms.

Also note that Corticon is able to find a potential mistake in our logic: Rules 3 and 4 are in conflict. A customer with coffee.qty=21 and tea.qty=19 would get $11.00 discount. That s probably not what we want. This can be resolved as follows by making the rules more precise: Summary Dealing with collections of data and associations between these collections is very common in virtually all non-trivial business rules applications. Corticon manages this by using: 1. The Scope to define the context and relationships between objects 2. The Filters to define what data is relevant to the rules in a particular rule sheet By using these features, Corticon is easily able to solve the Order Promotion problem. This gives the business user complete control and flexibility in defining eligibility for promotions and what discounts to apply no matter how complex they become. It s the Scope and Filter sections that distinguish the Corticon decision table from all others and make it possible to solve even very complex problems in a straightforward manner.