You use the samples console to run this sample.
To run this sample:
Switch to the Samples Console perspective.
In the Samples Commands view, navigate to
.To open the Samples Commands view, you can click the View sample commands link in the Samples and Tutorials view.
Execute the run command to compile and run the application.
The command creates a new Excel file named loanvalidation.xls with 60 scenarios.
If you want to change the number of scenarios, edit the property scenarioCount in <InstallDir>/teamserver/samples/dvscustompopulate/build.xml
Open the generated Excel file <InstallDir>/teamserver/samples/dvscustompopulate/populateExcel/data/loanvalidation.xls to check its contents, and then close Excel.
To use the Excel scenario file:
Sign in to Decision Center: http://localhost:<PORT>/teamserver.
Use the following role:
Username: rtsUser1
Password: rtsUser1
Switch to the loanvalidation-rules project.
On the Explore tab, click the Simulations smart folder, select the PopulateSample simulation, and then click Edit.
Click Step 3: Scenarios. Ensure that Excel (2003) is selected as the format. Click Browse and select <InstallDir>/teamserver/samples/dvscustompopulate/populateExcel/data/loanvalidation.xls.
Click Finish and Run.
Select Sample as the server and then click Run.
This command runs the simulation. It might take a few seconds.
To populate an Excel scenario file template using the API, the ExcelPopulate.populateExcelFile method, you require:
A template file that includes the correct column headings. You can generate a template in either Rule Designer and Decision Center. This sample generates a scenario file template in Decision Center.
A ruleset archive. This sample shows how to generate an archive from a rule project in Decision Center.
The model type. In this sample, it is a Java™ model object.
A property map to describe a complex conversion case from the BOM to DVS. In this sample, the complex case is the inner class Borrower.SSN. A converter is written in SSNConverter.convert. This method builds a string from the BOM SSN object.
Population of the scenario file with scenarios is performed by an IlrExcel2003ScenarioSuiteWriter, which is created from an IlrExcel2003ScenarioSuiteWriterFactory.
To add each scenario to the file, specify the following parameters:
The scenario ID.
The scenario description.
The scenario input parameters as a Map table. This Map table has one key per parameter. The keys of the map are the names of the ruleset input parameters to test, and the values are the XOM instances of the data.
The IlrExcel2003ScenarioSuiteWriter writes all the scenarios in an output stream using the write function.
The generated template contains one empty row which you must remove to have a usable populated Excel scenario file. A template without this extra row requires a custom scenario provider. A custom scenario provider is not the focus of this sample, and therefore, this sample does not show how to generate a template with 0 default rows. For more information about how to do this refer to Sample: Custom scenario providers and parallel execution.
The source files for this sample are located in <InstallDir>/teamserver/samples/dvscustompopulate/populateExcel/src/ilog/rules/dvs/samples/custom.
You can also view and modify the sample source files in Rule Designer. To import the sample into your workspace, click the Import projects link in the Samples and Tutorials view, and switch to the Java perspective.