Search…
SDK and Frameworks
Business Intelligence
Rule Test Bench
Test Bench is used to test rules in Dashboard.

Testing Rules

There are some steps to test your rules:
  1. 1.
    Select Rule & Version
  2. 2.
    Select API Key
  3. 3.
    Fill Request Body
  4. 4.
    Choose execution strategy
  5. 5.
    Click on Solve! button
  6. 6.
    Read Response

Select Rule & Version

  1. 1.
    The First step is to select the rule of what you want to test.
  2. 2.
    After selecting the rule, there are options to set a version of the rule. Otherwise, the last version of the rule will be used.

Select API Key

The Next step is to select some of the created API keys.
If no API key has been created, please follow Create API Keys instructions before starting Test Bench.

Fill Request Body

The Next step is to fill the request body.

Example Request Body simple:

1
{
2
"delivery": {
3
"tariff": "basic",
4
"distance": 50
5
},
6
"package": {
7
"weight": 5
8
}
9
}
Copied!

Example Request Body bulk:

Decision Table example:
Example Input:
1
[
2
{
3
"product": {
4
"id": "P1",
5
"price": 400
6
},
7
"paymentMethod": {
8
"debitCard": true,
9
"creditCard": false,
10
"cash": {}
11
}
12
},
13
{
14
"product": {
15
"id": "P2",
16
"price": 300
17
},
18
"paymentMethod": {
19
"debitCard": true,
20
"creditCard": {},
21
"cash": {}
22
}
23
}
24
]
Copied!
More examples and information are in Rule Solver.

Choose execution strategy

The next step is to choose a strategy, that you want to use.
Available in decision tables only.
All necessary information and differences about execution strategy

Solve!

The Last step is to click on
button.
After clicking on this button, your specified data (rule, request body, etc) is sent to Rule Solver.

Response

After solving, a response will show actual data.

Example of Response simple:

1
[
2
{
3
"car": {
4
"price": 666666,
5
"seats": {},
6
"discount": {
7
"low": 2,
8
"high": 33
9
}
10
}
11
}
12
]
Copied!

Example of Response bulk:

1
[
2
[
3
{
4
"suplier": "Amazon",
5
"amount": 400
6
}
7
],
8
[
9
{
10
"suplier": "Lenovo",
11
"amount": 300
12
}
13
]
14
]
Copied!
Example and more information are in Rule Solver.

Maximize Test Bench window

For a larger view of the Test Bench, you can use the maximize (
) button in the right corner.

Library Usage example

This component shows how to call Rule Solver in libraries.
It is possible to choose one compatible library. After that, the example will be shown in the code block. You can copy it or simply click on
button.

Example of Libary usage:

The INPUT data must be wrapped in -d '{"data":{...}}' - this is the default one.
1
curl https://test.api.decisionrules.io/rule/solve/fc70b265-c0df-5989-7dd9-17ed527a15ec/1
2
-X POST -H "Content-Type: application/json"
3
-H "Authorization: Bearer zgYtNXd8CBx4KFlO-9flmw-sLE_OUi3mKIeA4GINTIVVHe1GK1CFNTXgV4To-goZ"
4
-d '{"data":{"Size":{"Height":0,"Length":0,"Depth":0},"Distance":0,"Insurance":{"Class":1,"Value":0}}}'
Copied!

OR

The INPUT data must be wrapped in -d "{\"data\":{...}}" if you are using \ (backslash)
1
curl https://test.api.decisionrules.io/rule/solve/fc70b265-c0df-5989-7dd9-17ed527a15ec/1
2
-X POST -H "Content-Type: application/json"
3
-H "Authorization: Bearer zgYtNXd8CBx4KFlO-9flmw-sLE_OUi3mKIeA4GINTIVVHe1GK1CFNTXgV4To-goZ"
4
-d '{\"data\":{\"Size\":{\"Height\":0,\"Length\":0,\"Depth\":0},\"Distance\":0,\"Insurance\":{\"Class\":1,\"Value\":0}}}'
Copied!
For this component, you need to have at least one decision table and API key.