Connecting Apama Applications to External Components > Developing Custom Clients > The ScenarioService API > The ScenarioDefinition interface
The ScenarioDefinition interface
A class that implements the IScenarioDefinition interface represents a scenario (created with the Event Modeler) that is running in the correlator. ScenarioDefinition objects are returned from calls to the following ScenarioService methods:
*getScenarios()
*getScenarioByName()
*getScenarioByID()
With a ScenarioDefinition object, you can add and remove listeners, create new instances, get specific instances, and get meta information about the scenario, such as the scenario’s description, display name, and input and output parameter names and types.
The complete set of methods for classes that implement the IScenarioDefinition interface includes the following:
*void addListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener that will be notified of changes to any bound property of this object.
*void addListener() — defined as:

void addListener(
java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener that will be notified of changes to a specific named bound property of this object.
*IScenarioInstance createInstance(java.lang.String owner)
Create a new instance of this scenario, using default values for all input parameters.
*IScenarioInstance createInstance() — defined as:

IScenarioInstance createInstance(
java.lang.String owner,
java.util.Map<String, Object> inputParameters)
Create a new instance of this scenario, with the supplied values for input parameters.
*IScenarioInstance createInstance() — defined as:

IScenarioInstance createInstance(
java.lang.String owner,
java.util.Map<String, Object> inputParameters,
java.beans.PropertyChangeListener listener)
Create a new instance of this scenario, with the supplied values for input parameters, and atomically add a listener specified by listener.
*IScenarioInstance createInstance() — defined as:

IScenarioInstance createInstance(
java.lang.String owner,
java.util.Map<String, Object> inputParameters,
java.lang.String property,
java.beans.PropertyChangeListener listener)
Create a new instance of this scenario, with the supplied values for input parameters, and atomically add a listener. The property that the listener listens to is specified by the property argument.
*java.lang.String getDescription()
Get the description of the scenario.
*DiscoveryStatusEnum getDiscoveryStatus()
Get the status of the internal scenario instance discovery process.
*java.lang.String getDisplayName()
Get the display name of the scenario.
*java.lang.String getId()
Get the ID of the scenario.
*java.util.List<String> getInputParameterConstraints()
Get the constraints of all input parameters for the scenario.
*java.util.List<Object> getInputParameterDefaults()
Get the default values of all input parameters for the scenario.
*java.util.Set<String> getInputParameterNames()
Get the names of all input parameters for the scenario.
*java.util.List<ParameterTypeEnum> getInputParameterTypes()
Get the types of all input parameters for the scenario.
*IScenarioInstance getInstance(long instanceId)
Get a single specific instance of this scenario, by instance ID.
*java.util.List<IScenarioInstance> getInstances()
Get all instances of this scenario.
*java.util.List<IScenarioInstance> getInstancesForOwner(java.lang.String owner)
Get all instances of this scenario for a specific owner.
*java.util.Set<String> getOutputParameterNames()
Get the names of all output parameters for the scenario.
*java.util.List<ParmeterTypeEnum> getOutputParameterTypes()
Get the types of all output parameters for the scenario.
*boolean isInputParameter(java.lang.String parameterName)
Test if a specific named parameter is an input parameter.
*boolean isOutputParameter(java.lang.String parameterName)
Test if a specific named parameter is an output parameter.
*void removeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener that was to be notified of changes to any bound property of this object.
*void removeListener() — defined as:

void removeListener(
java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener that was to be notified of changes to a specific named bound property of this object.
When an application listener receives a PropertyChangeEvent from this interface, the event specifies the type of change. Notifications are available when ScenarioInstances have been added, edited, updated, removed, died, changed state or when the instance discovery mechanism for that particular definition changes. For more information on PropertyChangeEvents, refer to the Javadoc documentation.
Copyright © 2013-2015 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.