| ILOG JRules User Guide > Testing Rules with Rule Scenario Manager > Reference > Rule Scenario Manager XML and Java Artifacts > Simulation XML Definition |
Simulation XML Definition |
PREVIOUS NEXT |
A simulation is a number of scenario suites, normally two, with a common KPI whose executions are compared to indicate the relative performance of suites of scenarios. A simulation can have a common configuration for its constituent scenario suites, but each suite can be controlled by its own configuration, as can each suite's member scenarios. Simulations can be defined in XML files, in a Rule Studio wizard, and in the Rule Scenario Manager Console.
This section describes the simulation XML definition. Simulation definitions are governed by an XML schema (XSD) file located in <InstallDir>/doc/schemas.
A simulation definition is an XML input file that provides the following information:
The following is an example simulation definition that will be analyzed in the following sections:
<simulation>
<name>My first simulation</name>
<description>A little description</description>
<configuration>./data/scenario/loanValidationConfigurationXML.xml
</configuration>
<scenario-suites>
<scenario-suite>loanValidationSuiteExcel.xml</scenario-suite>
<scenario-suite>loanValidationSuiteXML.xml</scenario-suite>
</scenario-suites>
<kpi-class-name>loan.MyBestCoverageKpi</kpi-class-name>
<report>loanValidationSimulation1Report.xml</report>
</simulation>
Each simulation definition includes a name for the simulation, which is required to identify it, particularly in the Rule Scenario Manager Console. The name can be a string of up to 32 characters, avoiding special characters. For example:
<name>My first simulation</name>
You can also provide a short description for the simulation, although this is optional. For example:
<description>A little description</description>
Scenarios are associated with a configuration that determines how the scenario execution proceeds. For example, a configuration specifies the databinding classes required to map the input data to Java objects for ruleset execution.
Each scenario can have a configuration file associated with it, but you can also define one configuration to apply to all scenarios within a scenario suite, or to all scenario suites within a simulation. Simulation XML configuration file names and paths are set in the simulation definition. For example:
<configuration>./data/scenario/loanValidationConfigurationXML.xml
</configuration>
The simulation's configuration applies to all member scenario suites and their member scenarios except in the case where a scenario suite or a scenario is associated with its own configuration. That is, the lower-level configuration takes precedence. In a case where a scenario within the simulation has no configuration at any level, it cannot be executed.
For more information on configurations, see Configuration XML Definition.
Simulations are comprised of member scenario suites, which are listed by their definition XML filenames in the simulation definition. For example:
<scenario-suites> <scenario-suite>loanValidationSuiteExcel.xml</scenario-suite> <scenario-suite>loanValidationSuiteXML.xml</scenario-suite> </scenario-suites>
A key performance indicator (KPI) can be calculated over the results of the scenario suites in a simulation. The class that computes the KPI results is given in the simulation definition. For example:
<kpi-class-name>loan.MyBestCoverageKpi</kpi-class-name>
At the end of a simulation execution, the results are collected into a simulation report file, which can be in XML or Excel format, and HTML format in the Console. A simulation report contains the scenario suite reports for the member scenario suites, which includes the execution traces and test results of all member scenarios.
In a simulation definition, you supply the name of the file that will contain this report. For example:
<report>loanValidationSimulation1Report.xml</report>
A databinding class must be defined in the simulation's configuration file to map the scenario execution data to the report format required. See Configuration XML Definition for more information.
In the basics-javabinding sample, the class myPackage.MySimulationJUnit shows a simple simulation execution. This class runs as a JUnit test case and uses a Java XOM.
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |