Using Excel with an Oracle Policy Modeling rulebase model, you can easily analyze the results that different policy model versions yield, in order to decide which policies are the best ones to use. This is done by creating what-if analysis documents in the OPM project, providing the necessary inputs for the attributes, entities and relationships in Excel and using the batch processor to analyze the results.
Note that what-if analysis is only available when using Microsoft Excel 2007 or later.
Create a what-if analysis document
Populate the what-if analysis document with input data
Analyze the results of the policy model
Export the what-if analysis to CSV files
Export the what-if analysis to a test script file
A What-If Analysis document, based on the rulebase model of the project, can be created by following these steps:
The Excel what-if analysis file will now appear in the Project Explorer in Oracle Policy Modeling.
In order to analyze the results of your policy model, you must first enter your input data.
In the Project Explorer in Oracle Policy Modeling, double-click the what-if analysis document to open it in Excel.
Initially, the document will just contain a worksheet for the global entity. From this starting point you can add additional worksheets for entities and many-to-many relationships, and to each worksheet you can add new columns for attributes and other relationships.
To add an entity or many-to-many relationship to a what-if analysis document, you need to add a new worksheet:
Note that in your what-if analysis document you can have additional worksheets not intended for analysis, as long as there are no styled cells.
To add attributes or other (non many-to-many) relationships to an existing worksheet in a what-if analysis document, you need to add a new column:
Notes on formatting:
On the Global worksheet you need to:
On a non-global entity worksheet you need to:
In the examples above, Beth (Global ID #1) has taken three exams (Algebra, Calculus and Geometry), Anne (Global ID #2) has taken two exams (Grammar and Poetry) and Fran (Global ID #3) has taken one exam (Medieval History).
On a many-to-many relationship worksheet you need to:
For example, if you had a many-to-many relationship 'the child's parents' between 'the child' and 'the parent', and you defined the following parents and children:
Then on the worksheet for the child's parents (the many-to-many relationship) you would specify how these entity instances relate to one another:
This tells us that:
To analyze the results of the policy model, click the Analyze button on the Oracle Policy Modeling toolbar. (If your rulebase needs to be built, you will be prompted to do this now.) The document will be processed and, if successful, the output columns (ie the orange ones) will be populated with values.
Note that if there are errors in your what-if analysis document, the analysis process will cease, and you will be prompted to correct those errors.
Analysis is performed using the batch processor. For more information on this utility, see the Oracle Policy Automation Developer's Guide.
The what-if analysis can be exported to a set of CSV files that can then be run through the batch processor with zero configuration.
To export the what-if analysis to CSV files:
Note that if there are any errors, the export process will cease, and you will be prompted to correct those errors.
The number of CSV files that are exported corresponds to the number of relevant worksheets in the what-if analysis document. The input fields in the CSV files are the same as those in the what-if analysis document.
To run the CSV files through the batch processor, follow the steps for using the batch processor with zero configuration, making sure that you specify (i) the rulebase path, (ii) the location of the CSV files, and (iii) the output path for the CSV files.
After batch processing is complete, the output CSV files will be in the specified output directory. These files will show both the input and the determined output fields, with the same results as our what-if analysis document.
The what-if analysis can be exported to a test script file that can then be added to the rulebase project.
To export the what-if analysis to a test script file:
Note that if there are any errors, the export process will cease, and you will be prompted to correct those errors.
To add the generated tsc file to the rulebase project, go to File | Add |Add Existing File... and select the file.
When you open the test script file in the project you will notice that the number of test cases in the test script is the same as the number of global records in the associated what-if analysis document. The data in the test cases is the same as in the what-if analysis document.