Apama API Reference for .NET  9.10.0.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Apama.Services.Scenario.IScenarioDefinition Interface Reference

IScenarioDefinition is the public interface for a class that represents a Scenario (not an instance). More...

Public Member Functions

void AddListener (PropertyChangedEventHandler listener)
 Add a PropertyChangeListener that will be notified of changes to any bound property of this object. More...
 
void AddListener (string propertyName, PropertyChangedEventHandler listener)
 Add a PropertyChangeListener that will be notified of changes to a specific named bound property of this object. More...
 
IScenarioInstance CreateInstance (string owner)
 Create a new instance of this scenario, using default values for all input paramters. More...
 
IScenarioInstance CreateInstance (string owner, Dictionary< string, object > inputParameters)
 Create a new instance of this scenario, with the supplied values for input paramters. More...
 
IScenarioInstance CreateInstance (string owner, Dictionary< string, object > inputParameters, PropertyChangedEventHandler listener)
 Create a new instance of this Scenario, with the supplied values for input paramters, and atomically add a listener. More...
 
IScenarioInstance CreateInstance (string owner, Dictionary< string, object > inputParameters, string propertyName, PropertyChangedEventHandler listener)
 Create a new instance of this Scenario, with the supplied values for input paramters, and atomically add a listener. More...
 
IScenarioInstance GetInstance (long instanceId)
 Get a single specific instance of this scenario, by instance Id. More...
 
IScenarioInstance[] GetInstances ()
 Get all instances of this scenario. More...
 
ICollection< IScenarioInstanceGetInstancesForOwner (string owner)
 Get all instances of this scenario for a specific owner. More...
 
bool IsInputParameter (string parameterName)
 Test if a specific named parameter is an input parameter. More...
 
bool IsOutputParameter (string parameterName)
 Test if a specific named parameter is an output parameter. More...
 
void RemoveListener (PropertyChangedEventHandler listener)
 Remove a PropertyChangeListener that was to be notified of changes to any bound property of this object. More...
 
void RemoveListener (string propertyName, PropertyChangedEventHandler listener)
 Remove a PropertyChangeListener that was to be notified of changes to a specific named bound property of this object. More...
 
void RequestInstances ()
 Initiate requesting instances. More...
 

Properties

string Description [get]
 Get the description of the scenario. More...
 
DiscoveryStatus DiscoveryStatus [get]
 Get the status of the internal scenario instance discovery process. More...
 
string DisplayName [get]
 Get the display name of the scenario. More...
 
Dictionary< string, string > ExtraParams [get]
 Return a a shallow copy (new Dictionary) of the extra parameters. More...
 
string Id [get]
 Get the Id of the scenario. More...
 
ReadOnlyCollection< string > InputParameterConstraints [get]
 Get the constraints of all input parameters for the scenario. More...
 
ReadOnlyCollection< object > InputParameterDefaults [get]
 Get the default values of all input parameters for the scenario. More...
 
ReadOnlyCollection< string > InputParameterNames [get]
 Get the names of all input parameters for the scenario. More...
 
ReadOnlyCollection< ParameterTypeInputParameterTypes [get]
 Get the types of all input parameters for the scenario. More...
 
bool IsReadOnly [get]
 Return if the Scenario is read only or can have instances created, edited and deleted. More...
 
ReadOnlyCollection< string > OutputParameterNames [get]
 Get the names of all output parameters for the scenario. More...
 
ReadOnlyCollection< ParameterTypeOutputParameterTypes [get]
 Get the types of all output parameters for the scenario. More...
 
ScenarioType Type [get]
 Return the type of Scenario (i.e. DataView, Apama Query or neither). More...
 

Detailed Description

IScenarioDefinition is the public interface for a class that represents a Scenario (not an instance).

This interface provides an API for obtaining meta-information about a scenario (parameter names, types, constraints, etc), and for creating new instances of the scenario.

Each input parameter has an associated set of optional validation constraints, expressed as an XML string. The current implementation of the Scenario Service does not enforce these constraints, but provides access to them such that a client may enforce them outside of the service. The XML is useful to drive 3rd-party validation libraries, such as the Jakarta Commons Validator.

Member Function Documentation

void Apama.Services.Scenario.IScenarioDefinition.AddListener ( PropertyChangedEventHandler  listener)
void Apama.Services.Scenario.IScenarioDefinition.AddListener ( string  propertyName,
PropertyChangedEventHandler  listener 
)

Add a PropertyChangeListener that will be notified of changes to a specific named bound property of this object.

Parameters
propertyNameThe name of a specific property.
listenerThe listener to be notified.
See also
ScenarioDefinitionConstants.PropertyInstanceDiscoveryStatus
See also
ScenarioDefinitionConstants.PropertyInstanceAdded
See also
ScenarioDefinitionConstants.PropertyInstanceRemoved
See also
ScenarioDefinitionConstants.PropertyInstanceEdited
See also
ScenarioDefinitionConstants.PropertyInstanceUpdated
See also
ScenarioDefinitionConstants.PropertyInstanceDied
See also
ScenarioDefinitionConstants.PropertyInstanceStateChange
IScenarioInstance Apama.Services.Scenario.IScenarioDefinition.CreateInstance ( string  owner)

Create a new instance of this scenario, using default values for all input paramters.

If an instance cannot be created for any reason (other than invalid input parameters), the return value will be null.

Parameters
ownerid of the owner of this Scenario.
Returns

The newly created instance, or null if the creation failed.

Exceptions
InvalidInputParameterExceptionwhen any of the inputParameters is invalid. Note that future versions of this API may also throw this exception to indicate constraint violations.
IllegalCallingThreadExceptionif called from the data processing thread (i.e. from a PropertyChangeListener listening to an instance or definition).
IScenarioInstance Apama.Services.Scenario.IScenarioDefinition.CreateInstance ( string  owner,
Dictionary< string, object >  inputParameters 
)

Create a new instance of this scenario, with the supplied values for input paramters.

Any input parameters not supplied will take default values. If an instance cannot be created for any reason (other than invalid input parameters), the return value will be null.

Parameters
ownerid of the owner of this Scenario.
inputParameterscontains mappings from input parameter name to initial values.
Returns

The newly created instance, or null if the creation failed.

Exceptions
InvalidInputParameterExceptionwhen any of the inputParameters is invalid. Note that future versions of this API may also throw this exception to indicate constraint violations.
IllegalCallingThreadExceptionif called from the data processing thread (i.e. from a PropertyChangeListener listening to an instance or definition).
IScenarioInstance Apama.Services.Scenario.IScenarioDefinition.CreateInstance ( string  owner,
Dictionary< string, object >  inputParameters,
PropertyChangedEventHandler  listener 
)

Create a new instance of this Scenario, with the supplied values for input paramters, and atomically add a listener.

Any input parameters not supplied will take default values. If an instance cannot be created for any reason (other than invalid input parameters), the return value will be null.

Parameters
ownerid of the owner of this Scenario.
inputParameterscontains mappings from input parameter name to initial values.
listenera listener (all properties) to register atomically to the instance.
Returns

The newly created instance, or null if the creation failed.

Exceptions
InvalidInputParameterExceptionwhen any of the inputParameters is invalid. Note that future versions of this API may also throw this exception to indicate constraint violations.
IllegalCallingThreadExceptionif called from the data processing thread (i.e. from a PropertyChangeListener listening to an instance or definition).
IScenarioInstance Apama.Services.Scenario.IScenarioDefinition.CreateInstance ( string  owner,
Dictionary< string, object >  inputParameters,
string  propertyName,
PropertyChangedEventHandler  listener 
)

Create a new instance of this Scenario, with the supplied values for input paramters, and atomically add a listener.

Any input parameters not supplied will take default values. If an instance cannot be created for any reason (other than invalid input parameters), the return value will be null.

Parameters
ownerid of the owner of this Scenario.
inputParameterscontains mappings from input parameter name to initial values.
propertyNamethe property the listener listens to.
listenera listener to register atomically to the instance.
Returns

The newly created instance, or null if the creation failed.

Exceptions
InvalidInputParameterExceptionwhen any of the inputParameters is invalid. Note that future versions of this API may also throw this exception to indicate constraint violations.
IllegalCallingThreadExceptionif called from the data processing thread (i.e. from a PropertyChangeListener listening to an instance or definition).
IScenarioInstance Apama.Services.Scenario.IScenarioDefinition.GetInstance ( long  instanceId)

Get a single specific instance of this scenario, by instance Id.

Parameters
instanceIdThe Id of the required instance.
Returns
The specific instance.
IScenarioInstance [] Apama.Services.Scenario.IScenarioDefinition.GetInstances ( )

Get all instances of this scenario.

The returned List is a shallow copy (new List) of the instances.

Returns
A copy of the list (possibly empty) of all instances of this scenario.
ICollection<IScenarioInstance> Apama.Services.Scenario.IScenarioDefinition.GetInstancesForOwner ( string  owner)

Get all instances of this scenario for a specific owner.

The returned List is a shallow copy (new ICollection) of only the relevant instances. /remarks>

Parameters
ownerThe owner for which instances are required.
Returns
A collection (possibly empty) of all instances for the specific owner.
bool Apama.Services.Scenario.IScenarioDefinition.IsInputParameter ( string  parameterName)

Test if a specific named parameter is an input parameter.

Parameters
parameterNameThe name of a paramter to be tested.
Returns
true if the named parameter is an input parameter, false otherwise.
bool Apama.Services.Scenario.IScenarioDefinition.IsOutputParameter ( string  parameterName)

Test if a specific named parameter is an output parameter.

Parameters
parameterNameThe name of a paramter to be tested.
Returns
true if the named parameter is an output parameter, false otherwise.
void Apama.Services.Scenario.IScenarioDefinition.RemoveListener ( PropertyChangedEventHandler  listener)
void Apama.Services.Scenario.IScenarioDefinition.RemoveListener ( string  propertyName,
PropertyChangedEventHandler  listener 
)

Remove a PropertyChangeListener that was to be notified of changes to a specific named bound property of this object.

Parameters
propertyNameThe name of a specific property.
listenerThe listener to be removed.
See also
ScenarioDefinitionConstants.PropertyInstanceDiscoveryStatus
See also
ScenarioDefinitionConstants.PropertyInstanceAdded
See also
ScenarioDefinitionConstants.PropertyInstanceRemoved
See also
ScenarioDefinitionConstants.PropertyInstanceEdited
See also
ScenarioDefinitionConstants.PropertyInstanceUpdated
See also
ScenarioDefinitionConstants.PropertyInstanceDied
See also
ScenarioDefinitionConstants.PropertyInstanceStateChange
void Apama.Services.Scenario.IScenarioDefinition.RequestInstances ( )

Initiate requesting instances.

This is called automatically when the scenario is discovered after creating the scenario service after listeners on the service have been fired unless the IScenarioService.ConfigAutoInstanceDiscovery is set to false.

If the discovery status is not PENDING, this is a no-op.

Property Documentation

string Apama.Services.Scenario.IScenarioDefinition.Description
get

Get the description of the scenario.

This is not a formal description, but a human readable description provided by the scenario author.

Returns
The human readable description.
DiscoveryStatus Apama.Services.Scenario.IScenarioDefinition.DiscoveryStatus
get

Get the status of the internal scenario instance discovery process.

Returns
a static instance of the enum class DiscoveryStatusEnum to indicate the status.
string Apama.Services.Scenario.IScenarioDefinition.DisplayName
get

Get the display name of the scenario.

Returns
The display name.
Dictionary<string, string> Apama.Services.Scenario.IScenarioDefinition.ExtraParams
get

Return a a shallow copy (new Dictionary) of the extra parameters.

Returns
a copy of the Dictionary containing the extra parameters.
See also
ScenarioDefinitionConstants.EXTRA_PARAMS_METADATA_PREFIX
string Apama.Services.Scenario.IScenarioDefinition.Id
get

Get the Id of the scenario.

This is the Id of the scenario, not of an instance. This Id is unique within the Correlator.

Typically, the scenarioID will be a string derived from the scenario name that was used when the user saved the scenario from Scenario Manager. This Id is also the same as the namespace/package used for auto-generated MonitorScript for the scenario.

e.g. If the user saved the scenario with the name "limit-order", the Id would be "Scenario_limit$002dorder".

Returns
The scenario Id.
ReadOnlyCollection<string> Apama.Services.Scenario.IScenarioDefinition.InputParameterConstraints
get

Get the constraints of all input parameters for the scenario.

Each input parameter has an associated set of optional validation constraints, expressed as an XML string. The current implementation of the Scenario Service does not enforce these constraints, but provides access to them such that a client may enforce them outside of the service.

Returns
The read-only List (possibly empty) of all input field constraints. Each item is a XML string.
ReadOnlyCollection<object> Apama.Services.Scenario.IScenarioDefinition.InputParameterDefaults
get

Get the default values of all input parameters for the scenario.

Returns
The read-only List (possibly empty) of all input field default values. Each item is an object of the correct type.
See also
ParameterType
ReadOnlyCollection<string> Apama.Services.Scenario.IScenarioDefinition.InputParameterNames
get

Get the names of all input parameters for the scenario.

Returns
The read-only ordered Set (possibly empty) of all input field names - order is as required by the MonitorScript events.
ReadOnlyCollection<ParameterType> Apama.Services.Scenario.IScenarioDefinition.InputParameterTypes
get

Get the types of all input parameters for the scenario.

Note that these are not .NET types, but the types of the scenario parameters.

Returns

The read-only List (possibly empty) of all input field types.

See also
ParameterType
bool Apama.Services.Scenario.IScenarioDefinition.IsReadOnly
get

Return if the Scenario is read only or can have instances created, edited and deleted.

Returns
true is the Scenario is read only, otherwise false.
ReadOnlyCollection<string> Apama.Services.Scenario.IScenarioDefinition.OutputParameterNames
get

Get the names of all output parameters for the scenario.

Returns
The read-only ordered Set (possibly empty) of all output field names - order is as required by the MonitorScript events.
ReadOnlyCollection<ParameterType> Apama.Services.Scenario.IScenarioDefinition.OutputParameterTypes
get

Get the types of all output parameters for the scenario.

Note that these are not .NET types, but the types of the scenario parameters.

Returns

The read-only List (possibly empty) of all output field types.

See also
ParameterType
ScenarioType Apama.Services.Scenario.IScenarioDefinition.Type
get

Return the type of Scenario (i.e. DataView, Apama Query or neither).

Returns
ScenarioType enum.
See also
ScenarioType
Submit a bug or feature
Copyright (c) 2013-2016 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.