BizVR Tutorial - Gnorion/BizVR GitHub Wiki
BizVR Basic Tutorial - How to create your first decision model and decision table
This tutorial covers the basic mechanics of creating a decision model using the BizVR Decision Modeler. Other tutorials cover the methodologies that can be applied to decision modeling
Business Problem
Suppose your business needs to determine the price of toys using their color, size and shape. Let’s assume these are the business rules
- R1: small, red toys cost $5
- R2: large, square toys cost $10
- R3: green, oval toys cost $15
Modeling the Decision in a Formal Editor
Let’s also assume that we want to automate these rules so they can be applied automatically when someone visits our web page and puts items in their cart. For this tutorial we will use the BizVR Decision Modeler (there are many other modeling tools available)
http://gnorion.com:3202/main and you should see this screen:
1. Click on this URL2. Enter your user id and password
Once logged in you should see something similar to this.
- The default partition will be DECISION TABLE SAMPLES
- The folder named “Reference Examples” is a Workspace with some examples you can look at.
- Inside workspaces you can create projects.
- Inside projects you can create decisions.
- Inside decisions you can create decision tables and ontology definitions.
- Inside tables you can create individual rules
- Rules will consist of conditions and actions
3. Click the create new button to create a new Workspace
4. Give your workspace a name.
This workspace belongs to your user account. No one else can see the content of your workspace.
6. It will show up like this
7. Select it and click create new project. Give the project a name and click create
8. Select the project and click create new component, give it a name and click create
You can enter the inputs and outputs here
9 Select the component and click add new table, give it a name and click create
10. Now click on this decision table and add more condition rows
Add two more rows in the top (condition) section:
11. Now in the implementation column enter color, size and shape.
These are the three conditions and price as the single action. These are names of variables and need to conform to the usual variable naming conventions. You can also enter a more natural language form in the description column. You can put anything here. Now save the decision table
12. Now add two more rule columns by clicking on a rule column heading:
13. Now complete the table by filling in the rules. Don't forget to save it
14. Click on the Decision name to see the overall diagram of the decision. It will just have the one table and will display the inputs and outputs to that particular table. Currently they are the same as the inputs and outputs to the entire decision but as you add more tables you will see different inputs and outputs depending on what each table is doing
15. At this point you can run the validator to see if there are any problems
16. The validator will identify some issues
In the completeness section it will tell you that you have no rules for values other than the one you explicitly listed.
This may be ok if you know that no other values will be sent to the rules. But if other values might show up then its a good idea to add rules to deal with that situation (perhaps with an error message)
For example:
If you rerun the validator you will now see that all values are accounted for but there are still some combinations that are not covered:
Once you add new rules to cover these situations the completeness section of the validator report should be empty.
The final table might look like this
But suppose instead of writing rule 5 like this:
you had modeled it like this:
Would that cause a problem?
If the item was green, small and round what would the price be?
Should it be $15 according to rule 3 or $10 according to rule 5?
This is an inconsistency in the rules that we need to resolve.
When we run the validator it will identify this inconsistency:
Congratulations!
Next step - Update the decision properties with formal input and output declarations
-
Tutorial Defining The Decision Properties You need to set the inputs and outputs before you can use the validator
-
Tutorial How to test a decision model <<<< BEING REVISED, NOT CURRENTLY AVAILABLE, BUT STILL WORTH READING
-
Automatic Generation of Test Cases in JSON Format Using Validator