Task 5: Using domains with the Excel scenario file
You add domain values to the Excel scenario file.
About this task
In this task, you add selectable domain values for the type of property of the borrower, and see the effect in the generated Excel scenario file. Then, you add another value to the domain in both Rule Designer and the existing Excel scenario file.
Step 1: Adding domain values to the Excel file
About this task
Procedure
- Switch to the Rule perspective.
- In the Rule Explorer, double-click the PropertyInfo interface (loanvalidation-rules > bom > model > loan > PropertyInfo).
- In the Members area, double-click the PropertyInfo (String, String, int, int) constructor.
- In the Arguments area, double-click the propertyType argument.
- In the Method Argument dialog, click Edit on the Domain line.
- In the Domains wizard, select Literals as the domain type, and then click Next.
- Click Add, and then type Condominium.
- Click Add again and type Private House.
- Click Finish, and then click OK. Save your changes by using the save button in the Eclipse toolbar.
Step 2: Generating the Excel scenario file template
About this task
Procedure
- In the Rule Explorer, right-click the loanvalidation-rules project, and then click .
- Keep the default options as you did in the previous tasks.
- On the Expected Results page, expand the loan report, select approved and first message, and then click Next.
- Click Finish.
- In the Rule Explorer, double-click testsuite.xls to open it.
- Select the PropertyInfo sheet and click the property type cell in the Scenario 1 row. Click the arrow beside the cell to see the two values that you added in the domain.
- Close testsuite.xls.
Step 3: Adding a new domain value in Rule Designer:
About this task
Now you want to add a new value to the domain. You must first add it in Rule Designer. Then, you can either regenerate the Excel scenario file template, or, when the scenario file is already populated with data, you can edit the file directly.
Procedure
- Switch to the Rule perspective.
- In the Rule Explorer, double-click the PropertyInfo interface (loanvalidation-rules > bom > model > loan > PropertyInfo).
- In the Members area, double-click the PropertyInfo (String, String, int, int) constructor.
- In the Arguments area, double-click the propertyType argument.
- In the Method Argument dialog, click Edit on the Domain line.
- In the Domains wizard, click Add and enter Semi-detached.
- Click Finish, click OK, and then save your changes.
Step 4: Adding the domain value in the existing Excel file
About this task
In an Excel scenario file, information about the domains of the input data is stored in a hidden worksheet called _domains. The _domains sheet stores every domain that comes from the BOM in its own column, starting with column A, and creates a named range domainX that covers the cell range.
To add or remove domain entries manually in an existing scenario file, you must delete the named range, add the domain entries, and then redefine the named range.
Procedure
Results
You completed the Configuring the BOM for Excel testing tutorial, and learned how to generate an Excel scenario file template. Go to Running the completed tutorial if you want to run the completed tutorial.

