Tutorial How to test a decision model - Gnorion/BizVR GitHub Wiki

Tutorial How to test a decision model

Your decision currently looks like this:

image

While this correctly captures the decision and its component decision table, it is not yet executable.

In order to make it executable there are a number of additional steps:

  1. Define the decision table as a function with input and output arguments
  2. Define the inputs
  3. Define the output (as an invocation of the decision table function)

Here are the detailed steps

1. Click on the decision table and change its name to this:

image

Also make sure the values are in single quotes like this:

image

And modify the action line to return the result. Make sure to save it

Now edit the inputs and outputs to look like this:

image

2. To do this, exit to this screen

image

3. Click on this symbol to edit the decision meta data

image

4.and then select the Input/Output tab

image

4. Click + to add inputs and outputs and enter the following

image

5. Save and return to the decision diagram

image

Click on the symbol with nine dots (execution)

You will see this screen:

image

Enter the following json for your input values (or just copy/paste).

{ "color":"red","size":"small","shape":"square" }

image

And then click the little gear symbol to execute the rules.

You should see this (if you don't, carefully check the spelling and punctuation) :

image

Tutorial Testing with a collection of inputs