To specify that one or more procedures are executed when an event is processed, add the procedures to the relevant event map. The event map is included in the event disposition file. When the event is generated for a given model, the SpectroSERVER processes the event and executes the procedures.
CA Spectrum procedures can only be created using a text editor, not in the Event Configuration interface. CA Spectrum Event Configuration lets you view, but not edit, any procedures that you have associated with an event.
Associate an event procedure with an event by creating an event disposition action. Start the action with the 'P 'action code, and then contain the procedure code within double-quotation marks.
Note: Both the current event and the current model are required for proper procedure execution. The SpectroSERVER sets both of these parameters automatically.
Follow these steps:
SS/CsVendor/vendor_directory
$SPECROOT/SS/CsVendor/CA/Procedures
event_code E event_severity processing_parameters P procedure
Specifies the event code of the event.
Identifies the action code that indicates the event data is logged by the Archive Manager in the Distribute Data Manager (DDM) database.
Specifies the relative severity of the event on a scale of 0 to 100.
Specifies additional event processing behaviors, such as whether the event generates an alarm, clears one or more alarms, or executes one or more event rules.
Specifies the action code that indicates that a procedure follows.
Specifies the procedure to execute. To specify multiple procedures, use multiple instances of P procedure.
The server sets the correct environment for the procedure evaluation, with the current model and event preset.
Event disposition procedures are parsed once during server startup, producing an executable procedure object. When it receives the event for the procedure, the server evaluates the procedure object and performs the specified operations.
Example
The following event map executes a procedure that creates event 0xabcd0002 on the device model of a port, which is retrieved by reading the Device_Mdl_Handle attribute (0x10069). Event 0xabcd0002 has copies of all of the event variables in the original event.
0xabcd0000 E 50 \
P "CreateEventWithVariables( \
ReadAttribute( { C CURRENT_MODEL }, { H 0x10069 } ), \
{ H 0xabcd0002 }, \
GetEventVariableList() \
)"
In the example, CURRENT_MODEL is a predefined constant that refers to the current model. The model is automatically set in the environment by the SpectroSERVER when the event is processed.
As shown in the example, a procedure must be fully enclosed in double quotes. The procedure must have a procedure name and can take parameters. Parameters follow the procedure name. Both values and constants (direct values) must be enclosed in braces and separated by commas. For example, the following syntax is valid:
A procedure call can be inserted by using the procedure name with its parameters. Add arguments in braces. For example:
ReadAttribute( { C CURRENT_MODEL }, { H 0x1006e } )
If a procedure spans multiple lines, use the line continuation character to indicate that each line continues a single event map.
You can use any number of procedures in an event map. No limit on the procedures that you can use from an event disposition file is enforced.
Note: The custom (user-defined) event procedures are read-only in the Event-Configuration editor.
|
Copyright © 2014 CA.
All rights reserved.
|
|