Search…
SDK and Frameworks
Business Intelligence
Create Simple Decision Table

1. Sign in

Becoming a superhero is a fairly straight forward process:
After entering the app.decisionrules.io page, the login screen will be displayed.
There are two options for user login. Sign in with:
  • email and password
  • Google Account (SSO)
After logging in to the application, the Dashboard will be displayed.

2. Go to Decision Tables

To go to the Decision Table page on the left in the sidebar, click on the Decision Table link. After clicking on the link, a page with all already created decision tables will be displayed.

3. Create a new Decision Table

To create a new rule, click the button
. After clicking, you can choose between SAMPLE RULE or EMPTY RULE to create**.** Choosing either one the new rule will be created and its detail will be displayed automatically.
More information is here.

4. Set decision table information

When we are at the detail of the decision table, we first set some information. We will change the name of our decision table. To do this, click on his name. Then a field will appear where we can rename the name and click on the
icon. To cancel the changes, click on the
icon.
Since we do not want this decision table to be available yet, we will change its status to "Pending". To do this, click on the current status "Published" and then select "Pending".
For applying these changes, we have to click on the
button on the bottom of the page.

5. Create an Input and Output model

We will now create an input and output model, which we will then use to set conditions and results. You must be in Rule Settings. There are 2 ways to create these models:
  • Simple editor: It is intended for inexperienced users who do not know the syntax of JSON files.
  • JSON editor: It is intended for an experienced user.

Create with a simple editor

After creating an input or output model, we must always confirm the changes with the
button

Input model

First, we delete all created objects by clicking on the icon. Then we will add our specified requirements (age, criminal history, mileage per year). In our case, we create a root for each request by clicking on the button.
If our model were more complex, we would add descendants. More information is described here.

Input model Example:

Output model

We set the output model similarly, where we set as root eligibility and measure.
Output model Example:

Create using JSON editor

Input model

First**,** we will create one object into which we will put other objects with our requirements. We will create one empty object for each request.
Because our model is simple, these objects do not contain any others. For more complex models, more information is here.

Input model Example:

1
{
2
"Age": {},
3
"Criminal history": {},
4
"Mileage per year": {}
5
}
Copied!

Output model

We set the output model similarly, where we set as root eligibility and measure.
Output model Example:
1
{
2
"Eligibility": {},
3
"Level": {}
4
}
Copied!

6. Creating Conditions and Results

To create conditions and result you must go to the second tab - Table Designer.
Now let's move on to binding models to conditions and results and create individual rules.

Creating Conditions and Results

For simplicity, we will remove all conditions and results by clicking on the icon
next to them. Next, we add 5 conditions by clicking on the
icon. Although we have only 3 variables in the input model, we will want to compare the values in some range for the age and mileage. Therefore we have to add these conditions (Age min, Age max, Criminal history, Mileage per year min, Mileage per year max) **** and 2 results by clicking on the
icon because similarly, we have 2 variables in the output model.
More information about creating conditions and results is here.
After adding conditions and results, we will set their names. **** To do this, click on his name. Then a field will appear where we can rename the name and click on the
icon. To cancel the changes, click on the
icon.

Binding models to conditions and results

Now let's move on to binding values from models. To bind the value, click on the
icon. Then we will see a list of all available values and select one of them. This is how we bind the value for all conditions and results.
More information about binding models to conditions/results is here.

After performing these tasks, the Decision Table designer should look like this:

7. Creating rules

For simplicity, we will remove all rows of the table or conditions.
Each row of the table corresponds to exactly one rule. When Rule Solver is called, it goes through the individual lines and compares their condition values with those specified in the request. If some values of the conditions in a row match, Rule Solver returns the values of the individual results of that row.
Now let's add one rule (one line). We do this by clicking on the
button. In this rule, we set that if the user is between the ages of 25 and 40, will not have a criminal record, and will have an annual mileage of more than 20,000 km, the user will be eligible to drive a taxi and will have a high level.
We will now start setting individual conditions and results. For the "Age min" condition, set the operator to "Greater than or equal" and the value to 25. To set the operator, click on the existing operator and a list will appear from which you can select.
For other conditions, we set operators and values similarly. For the condition "Age max" we set the operator "Less than or equal" and the value to 40. For the condition "Criminal history" we set the operator to "Equals" and the value to false. For the condition "Mileage per year min" we set the operator to "Greater than and equal" the value to 25000 and for the condition "Mileage per year max" we set the condition to "Anything" because it does not matter what the value will be.
Set the value to true for the result "Eligibility" and set the value to high for the result "Level".
An overview of all operators is here. An overview of all possible values is here.

After performing these tasks, the Decision Table designer should look like this:

We can similarly add other conditions.

8. Test created decision table

Now we can test our rule in Test Bench. Before testing the rule, we must change the status of the decision table to "Published".
If we want to test a certain rule (line), we can click on the
icon next to the line. After clicking on the icon, the values from the line will be pre-filled in the Request Body in Test Bench, which will show up at the bottom of the page. We can freely modify these values.
Then we can either click on the
button and the result will be displayed in Response or we can copy the pre-prepared command to our library from the Library Usage Example.

Request body example:

1
{
2
"Age": 28,
3
"Criminal history": false,
4
"Mileage per year": 30000
5
}
Copied!

Response body example:

1
[
2
{
3
"Eligibility": true,
4
"Level": "high"
5
}
6
]
Copied!
More information about Test Bench is here.