
A bank customer wants to receive a loan between 50K and 80K for the period from 24 to 96 months. The customer provides this information along with his/her monthly income and monthly debt. The bank has a decision model that runs behind the scenes somewhere on the bank’s server. The customer has access to a self-service interface that helps him/her select the most appropriate loan conditions. This sample demonstrates how OpenRules Decision Playground can be used to choose the best loan.
Decision Playground as a Graphical Interface
The proper decision model is implemented as a simple example, “Loan,” that comes with OpenRules Rule Solver. We will describe its implementation at the end of this page. When you click on “Loan/play.bat”, it will start the standard OpenRules Decision Playground that will be used as a self-service to help the customer choose the most appropriate loan. Here is your playground’s view after you click on the “New Request” to select a JSON file with your input data:

The proper JSON files, such as “testCases-1.json,” were generated based on the proper test cases in Excel during the testing of the decision model. Still, you may also create a JSON request manually. Here is the Decision Playground’s view after selecting the JSON request with input data and clicking on “Find Decision”:

So, this decision offers you a loan with the amount of $50,000 for 24 months and a monthly payment of $2,083. You may continue to click on “Next Decision” and see other possible decisions until you reach decision #14. You can also find decision #14 right away by clicking on “Last Decision” and using “Previous Decision” to look at previous ones. If you like any reached decision, you may click on “Add to Pool” to save this decision in the Decision Pool.
Instead of finding decisions manually, you may ask Decision Playground to find an optimal solution by clicking on “Optimize” and selecting the preferred optimization objective:

It will generate an optimal decision that maximizes the “Loan Amount”:

You will see the complete decision and save it in the Decision Pool:

This decision offers you a loan with the amount of $65,000 for 36 months and a monthly payment of $1,803. Let’s say you decide to choose a decision that minimizes your monthly payment. Then you click again on the Optimize and make the following selection:

Here is another optimal decision:

This decision offers you a loan with the amount of $50,000 for 96 months, but with the smallest possible monthly payment of $520. What if you don’t mind paying a bit more per month, but to receive a larger loan amount? In this case, you may choose to maximize the Integrated Objective, which is a sum of Loan Amount and Loan Term:

And here is the proper decision:

After saving all 3 decisions in the pool, you may see all of them by clicking on “Decision Pool”. The following dialog will pop up:

You can now review all three decisions to determine which one you prefer. By selecting a decision inside the pool, you will see all decision details in the main view.
Considering these three decisions, the third one appears to be the best. However, let’s say you could allow yourself to pay a bit more per month. Can Decision Playground help you find the proper decision? The answer is “Yes”.
When you click “Optimize” again, you can add a filter specifying that the Monthly Payment must be greater than 677:
<image with a filter>
It will produce a decision with the same Loan Amount of $65,000 for 72 months and with the monthly payment of $902. Of course, you can add many other filters.
This example is based on a very simple decision model – see file “openrules.solver/Loan/rules/DecisionModelLoan.xls”. Here is the Glossary:

Here are two main methods “Define” and “Solve” that are pretty common for Rule Solver decision models:

The “Define” invokes two decision tables:

The “Solve” relies on the standard solving method “SolveWithOptions”.
