You create new scenario providers in Rule
Designer to
use with the Scenario Service Provider (SSP). The SSP uses the provider
to execute the scenarios defined in the scenario suite.
About this task
You create new scenario providers to retrieve the input
data for your tests from a data source. A scenario provider is made
available to business users in the Decision
Center Enterprise
console by referencing the DVS format.
Rule
Designer generates Java™ class templates to help you:
Create a standard scenario provider, or a scenario provider
that supports parallel execution of a simulation
Define how to access the scenarios at run time
Retrieve user input from Decision
Center and
initialize your scenario provider at run time
Create an Eclipse launch configuration to run tests in Rule
Designer using
the new scenario provider
After you create a scenario provider, you must make the
DVS format available to business users in the Enterprise console.
Procedure
To create a scenario provider:
- Right-click a DVS Project and click .
The New DVS Format wizard opens.
Note: You
can also click Create in the Format section
of the DVS Customization.
- On the New Format to a Project page,
select the DVS Project, and then click Next.
- Enter a name for the format.
- Define the precision level, and then click Next.
By default, the precision is set to two digits. You can enter
a different number or use all the digits for comparison.
- On the Scenario Provider page, choose
one of the following options:
- Select an existing provider from the menu, and click Finish to
generate your new provider classes using this class.
The Excel
scenario provider class is selected by default. The message below
the menu informs you whether parallel execution of a simulation is
supported by the selected provider.
Go to step 5.
- Click Create a new Scenario Provider.
The New
DVS Scenario Provider dialog opens.
- In the Package Name field on the
New DVS Scenario Provider page, enter a name for the package in which Rule
Designer generates
the scenario provider classes.
- In the Class Name field, enter
a name for the main scenario provider class.
- Select the Generate a scenario provider to
support parallel execution for a simulation check box
if you to want to use this feature. For more information,
see Parallel execution.
- By default, Rule
Designer generates
the Decision
Center renderer
class template, and the launch configuration plug-in project. Clear
the check boxes if you do not want to generate them.
- Click Finish.
Rule
Designer creates
the Java class templates in
the src/<PackageName> directory of the
DVS Project.
If you used the default option, Rule
Designer also
creates the plug-in project for the launch configuration in your workspace.
The custom scenario provider displays in the Scenario
Provider section of the format editor.
- You must now implement the required
code in the Java class templates.
The DVS Project contains one of the scenario provider class
templates and a renderer class template in src/<PackageName>.
The provider class depends on the type of scenario provider you generated:
Java class template |
Definition |
ScenarioProvider.java |
An implementation of IlrScenarioProvider provides
access to the scenarios at run time. This type of scenario provider
does not support parallel execution. |
ParallelScenarioProvider.java |
An implementation of IlrParallelScenarioProvider provides
access to the scenarios and divides them into a set of parts at run
time. This type of scenario provider supports parallel execution. |
ScenarioSuiteResourcesRenderer.java |
Use an implementation of IlrScenarioSuiteResourcesRenderer to
customize the Decision
Center GUI
for the Scenarios step when creating Test Suite
and Simulation artifacts. |
To implement the scenario provider classes:
- In the DVS Project, double-click the classes in src/<PackageName>.
The Java class templates
include TODO comments to indicate the parts to complete.
- Open the Tasks view to display
the list of TODO tasks in the Java class template.
- Replace the TODO comments by the required
code.
- Save the changes.
- To run a test in Rule
Designer using
your new scenario provider, you must build the plug-in to make the
launch configuration for your custom scenario provider available in
the Run Configurations or in the Debug
Configurations dialogs.
The launch configuration
plug-in project contains the following class templates:
Java class template |
Definition |
MyScenarioProviderLaunchConfigurationDelegate.java |
This class extends IlrDVSLaunchConfigurationDelegate, which accesses
and verifies launch configuration attributes. |
MyScenarioProviderRunner.java |
This class extends IlrDVSRunner, which calls Decision Validation Services and
the SSP to execute scenarios. |
MyScenarioProviderLaunchConfigurationTabGroup.java |
This class implements IlrDVSLaunchConfigurationTabGroup, which defines
the tabs and the display order of the tabs for the DVS launch configurations. |
MyScenarioProviderTab.java |
This class extends IlrDVSMainTab, which defines
the main tab of a DVS launch configuration and the elements to specify. |
MyScenarioProviderClasspathTab.java |
This class extends IlrClasspathTab, which defines
the classpath used to run scenarios.Note: Check the path to make
sure that you build the plug-in in the right directory.
|
To implement the plug-in classes:
- In the plug-in project, double-click the classes in src/<PackageName>.
The Java class templates
include TODO comments to indicate the parts to complete.
- Open the Tasks view to display
the list of TODO tasks in the Java class template.
- Replace the TODO comments by the required
code.
- Save the changes.
- You can now test the plug-in to check that the new launch
configuration displays in the Run Configurations and Debug
Configurations dialogs, and contains the elements defined.
To check the launch configuration:
- In the Rule Explorer, select the plug-in project.
- Click .
- In the Run As dialog, select Eclipse
Application, and click OK to launch
the new Eclipse program.
A new Eclipse application
opens.
- Click .
The new launch
configuration perspective displays on the side pane in the Run
Configurations dialog.
You can now deploy the launch
configuration plug-in to make it available in Rule
Designer (see Deploying a plug-in) and use the new scenario
provider to run tests in Rule
Designer (see Overview of testing in Rule Designer).
- After you implemented your new scenario provider in Rule
Designer,
you must make it available to business users in the Decision
Center Enterprise
console.
To make the format available in the Enterprise
console:
- Repackage the SSP and Decision
Center archives,
as described in Repackaging the SSP and Decision Center archives.
- Deploy the repackaged files to your application server.
Results
You must make formats that you create or modify in Rule
Designer
and deploy to Decision
Center accessible
to the business user. Click in the Enterprise console,
and refer to the online help for further information.