To validate rules and make sure that the changes have the effects that you want, you can test rules against scenarios. In this task, you create a scenario file to run tests on your rules.
Business users can also create scenario files in Decision Center, but you must first prepare the rule project in Rule Designer.
This task should take you about 20 to 30 minutes to complete.
The test data of the Excel scenario file is created from the ruleset input parameters. The BOM classes that make up the input parameters have constructors that define the columns in the Excel scenario file.
Before creating a scenario file, you must define the DVS constructor for the Borrower class. The DVS constructor that you select defines the mandatory columns.
In this tutorial, the name, credit score, and yearly income of the borrower are mandatory to test the rules.
To select a DVS constructor:
You have defined the constructor to create the mandatory input columns for the borrower in the Scenarios sheet.
For the purpose of this tutorial, the DVS constructor of the Loan class is already selected for you.
The miniloan XOM contains annotations that specify the names of the constructor arguments, and indicates that Loan(int, int, double) is the constructor to use for testing. To view the annotations used, take a look at miniloan-xom/src/miniloan/Borrower.java and miniloan-xom/src/miniloan/Loan.java. For more information on annotations, see Adding annotations to the XOM.
To check your project:
After checking that your project does not contain any errors or warnings, you create an Excel scenario file template to validate the behavior of your rules.
To create the Excel scenario file:
To populate the Excel scenario file:
To test that the scenario works as expected, you run the Excel scenario file locally in Rule Designer.
To test the Excel scenario file locally:
Now that you have made some changes to the BOM, in the next task you will see how to debug the rule project using the Excel file.