ILOG JRules User Guide > Testing Rules with Rule Scenario Manager > Reference > Rule Scenario Manager XML and Java Artifacts > Scenario Suite XML Definition

A scenario suite is a collection of scenarios together with a key performance indicator (KPI) that measures the performance of the executions of the scenarios. Scenario suites can have their own configuration files, but each member scenario can retain its own configuration that take precedence over the suite's configuration. Suites can be defined in XML files, in Rule Studio using a wizard, and in the Rule Scenario Manager Console.

This section describes the scenario suite XML definition. Scenario suite definitions are governed by an XML schema (XSD) file located in <InstallDir>/doc/schemas.

A scenario suite definition is an XML input file that provides the following information:

The following is an example scenario suite definition that will be analyzed in the following sections:

<scenario-suite>
  <name>loanValidation Suite XML</name>
  <description>A little description</description>
  <configuration>./data/scenario/loanValidationConfigurationXML.xml
      </configuration>
  <scenarios>
    <scenario>loanValidationXML1.xml</scenario>
    <scenario>loanValidationXML2.xml</scenario>
  </scenarios>
  <kpi-class-name>loan.MyCoverageKpi</kpi-class-name>
  <report>loanValidationSuiteReport1.xml</report>
</scenario-suite>

Name and Description

Each scenario suite definition includes a name for the suite, which is required to identify it within simulations and in the Rule Scenario Manager Console. The name can be a string of up to 32 characters, avoiding special characters. For example:

<name>loanValidation Suite XML</name>

You can also provide a short description for the scenario suite, although this is optional. For example:

<description>A little description</description>

Configuration

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. Scenario suite XML configuration files and paths are given in the scenario suite definition. For example:

<configuration>./data/scenario/loanValidationConfigurationXML.xml
    </configuration>

The suite's configuration applies to all member scenarios except in the case where a member scenario is associated with its own configuration. That is, the lower-level configuration takes precedence. In cases where a scenario has no configuration at either scenario or scenario suite level, the parent simulation configuration applies. If a scenario is not associated with any configuration, it cannot be executed.

For more information on configurations, see Configuration XML Definition.

List of Scenarios

Scenario suites are comprised of member scenarios, which are listed by their definition XML filenames in the scenario suite definition. For example:

<scenarios>
  <scenario>loanValidationXML1.xml</scenario>
  <scenario>loanValidationXML2.xml</scenario>
</scenarios>

KPI

A key performance indicator (KPI) can be calculated over the results of the scenarios in a scenario suite. The class that computes the KPI results is given in the scenario suite definition. For example:

<kpi-class-name>loan.MyCoverageKpi</kpi-class-name>

Scenario Suite Report

At the end of a scenario suite execution, the results are collected into a scenario suite report file, which can be in XML or Excel format, and HTML format in the Console. A scenario suite report contains the scenario reports for the member scenarios, including the execution traces and test results.

In a scenario suite definition, you supply the name of the file that will contain this report. For example:

<report>loanValidationSuiteReport1.xml</report>

A databinding class must be defined in the scenario suite's configuration file to map the scenario execution data to the report format required. See Configuration XML Definition for more information.

Examples

In the basics-xmlbinding sample, the classes myPackage.MyScenarioSuiteJUnit and myPackage.MyScenarioSuiteMain show a simple scenario suite execution. The first class runs as a JUnit test case and the second shows how to use the Rule Scenario Manager API in a plain Java execution. This example uses a dynamic XOM.

In the basics-javabinding sample, the class myPackage.MyCustomSuiteJUnit tests the myPackage.userDefined.CustomSuiteExcelBinding databinding class as a JUnit execution.

Related Concepts

Scenario Suites
Scenario Suite Report
Configurations
Scenario Suite KPI

Related Tasks

Defining Rule Scenario Manager Artifacts
Adding a Scenario Suite to a Project

Related Reference

Scenario XML Definition
Simulation XML Definition
Configuration XML Definition

Related Samples

How to Test Rules in Rule Scenario Manager Using Java Binding
How to Test Rules in Rule Scenario Manager using XML Binding