|pMe||(Object) Reference to the PROMOTIC object where the event rises.|
|pEvent||(Object) A referrence to object describing detailed information about the specific event.|
pEvent.Item - (Object) The reference to the alarm/event item (to the PmAlarmEventItem object) that was changed.
pEvent.Action - (Long) Indication of the change type
0 - alarm was activated (See method PmAlarmEventItem.Activate)
1 - alarm was inactivated (See method PmAlarmEventItem.Inactivate)
2 - alarm was acknowledged (See method PmAlarmEventItem.Acknowledge)
3 - alarm has been changed by the system to NEW non-initialized inactive acknowledged (green) alarm. See the configurator "Change inactive confirmed (green) CEASED to NEW non-initialized alarms in [s] (-1=never)".
pEvent.Context - (Object) Reference to the object containig additional information about the user, that executed the action followed by calling this event. The creation and demise of the alarm is always done by the local user. The alarm confirmation can be executed both by local and network application user (e.g. from the Web). The user info can be used, for example, for enabling/disabling the action (if possible), or for entering the user info into the alarms/events.
pEvent.Context.User - reference to the User object, containing detailed information about the user (local or network), that executed the action that called the method.
Caution! In order to keep the subobject User value trustworthy it is necessary to exclude the the pseudo-groups $ANY and $ANY_NET from the appropriate permission WebRead (i.e. to ensure that the user is logged in when opening the Web pages).
Select Case pEvent.Action
sAction = "ACTIVATE"
sAction = "INACTIVATE"
sAction = "ACKNOWLEDGE"
sAction = "??"
Pm.Debug "Event onStateChange:"
Pm.Debug "Action = " & sAction
Pm.Debug "Description = " & pEvent.Item.Description