Every application has to make decisions

Left or right, shipping charges, dynamic pricing and underwriting rules. Hard-coding those decisions makes it difficult to test, change or revert to an older version. We host your decision tables and expose them as an API.

Do you spend hours of coding complex logic with if-then-else statements?

problem

Think of underwriting rules in the insurance industry, enrollment and eligibility in health, up-/cross-sell, dynamic pricing and shipping charges in retail.

Have you ever tried DecisionTables?

problem

A decision table is a powerful and easy way to represent logic in a tabular format. Your business guy loves it too.

problem

You would be the magician!

problem

You would define them in a Google Spreadsheet and execute them via a RESTful API.

The old, “CLASSIC” way

image description

Example of shipping charges

Calculating shipping charges

Purchase Amount Over $250.00
Number of Items 3 or less 4 or more
Delivery Day Next 2nd day Std. Next 2nd day Std.
Shipping Charge [$] 25 10 N* $1.50 N* $6.00 N* $2.50 FREE
Purchase Amount Less than $250.00
Number of Items 3 or less 4 or more
Delivery Day Next 2nd day Std. Next 2nd day Std.
Shipping Charge [$] 35 15 10 N* $7.50 N* $3.50 N* $2.50
image description

Example Java code


    public double calculateShippingCharge
    (double purchaseAmount, int numberOfItems,
    String deliveryDay){
            if(purchaseAmount > 250000){
                if(numberOfItems <= 3){
                    if(deliveryDay == "next day")
                        return 25;
                    else if(deliveryDay == "2-nd day")
                        return 10;
                    else return numberOfItems*1.5;
                }
                //number of items is four or more
                else{
                    if(deliveryDay == "next day")
                        return numberOfItems*6;
                    else if(deliveryDay == "2-nd day")
                        return numberOfItems*2.5;
                    //FREE
                    else return 0;
                }
            }
            //purchaseAmount less or equal to 250K
            else{
                if(numberOfItems <= 3){
                    if(deliveryDay == "next day")
                       return 35;
                    else if(deliveryDay == "2-nd day")
                        return 15;
                    else return 10;
                }
                //number of items is four or more
                else{
                    if(deliveryDay == "next day")
                        return numberOfItems*7.5;
                    else if(deliveryDay == "2-nd day")
                        return numberOfItems*3.5;
                    else return numberOfItems*2.5;
                }
            }
        }
                                

The Wizard way

image description

How would you implement this?

Calculating shipping charges

ApplicantType
ApplicantAge ApplicantSex Outcome
less than 16 N/A Rejected
between 16 and 60 N/A Accepted
between 61 and 64 Male Accepted
Female Rejected
greater or equal than 65 N/A Rejected
ApplicantCredit
CreditScore CreditHistoryRating Outcome
between 0 and 12 0 Rejected
between 1 and 19 ??
between 20 and 50 Accepted
13 N/A ??
between 14 and 18 0 Accepted
between 1 and 50 Rejected
greater than 18 0 ??
between 1 and 19 Accepted
between 20 and 50 ??
ApplicantBorrowingRiskGrade
BorrowingAmount LendingType Outcome
between 1000 and 9999 Secucode-red ??
Unsecucode-red 3
between 10000 and 49999 Secucode-red 1
Unsecucode-red 4
50000 N/A ??
between 50001 and 99999 Secucode-red 2
Unsecucode-red 5
LendingDecision
ApplicantType ApplicantCcode-redit BorrowingRiskGrade Outcome
Accepted Accepted between 1 and 3 Approved
between 4 and 5 Referral
Rejected 1 Approved
between 2 and 5 Declined
Rejected N/A N/A Etc...

To show you how,
give it a try

Here is the CURL command...

curl --data
“applicant.age=20&applicant.gender=male&
ccode-redit.score=3&ccode-redit.history_ranking=5&
borrowing.amount=5000&lending.type=unsecucode-red”
http://decisiontabl.es/api/NIniu2s9fs
                                
...and the result

{
   "case_id":"5El",
   "facts":[
      {
         "concept":"dialog",
         "attrib":"approve order",
         "value":"n_a",
         "queue":"managers",
         "because":[
            {
               "concept":"total",
               "attrib":"order",
               "op":"g_than",
               "value":100
            }
         ]
      },
      {
         "concept":"order",
         "attrib":"discount",
         "value":20,
         "queue":"undefined",
         "because":[
            {
               "concept":"total",
               "attrib":"order",
               "op":"le_than",
               "value":2000
            },
            {
               "concept":"total",
               "attrib":"order",
               "op":"ge_than",
               "value":1001
            },
            {
               "concept":"customer",
               "attrib":"level",
               "op":"eq",
               "value":"gold"
            }
         ],
         "is_ref":false
      }
   ]
}
                                

Get yourself a DecisionTables licence key.