Promotic

onUserItemAction - event of the PmaAlarmGroup object

Description:
The event is triggered when selecting the corresponding action in the alarm state viewer by the local/net user.
Parameters:
pMe(Object) Reference to the PmaAlarmGroup object where the event rises.
pEvent(Object) Reference to object describing detailed information about the specific event.
pEvent.Action - (String) [for reading] Specifies the selected action over the alarm item.
ack - The user selected the acknowledgement of the selected alarm in the alarm state viewer.
ackall - The user selected the acknowledgement of all alarms in the alarm state viewer.
pEvent.ItemId - (String) [for reading] The identifier of the selected alarm item (if it doesn't go about multiple operation).
pEvent.TimeOn - (Date) [for reading] The rise time of the selected alarm item (if it doesn't go about multiple operation). It goes about supplementary information to the identifier of the alarm item, that allows unambiguous idenfication of the selected alarm item. If it is allowed to store inactive, unacknowledged (blue) alarms in the "Number of inactive, unacknowledged older copies of the (blue) alarm" configurator, then more alarm items can have the same identifier.
pEvent.Context - (Object) [for reading] The reference to the object containing additional information about the user, that executed the action followed by triggering this event. The creation and termination of the alarm is always done by the local user. The alarm acknowledgement 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.
pEvent.Context.User - The reference to the PmUser object, containing detailed information about the user (local or network), that executed the action that triggered this event.
Caution! In order to keep the subobject User value trustworthy it is necessary to exclude the pseudo-groups $ANY and $ANY_NET from the appropriate "WebRead" permission (i.e. to ensure that the user is logged in when opening the Web pages).
pEvent.Context.Language - Returns the information about the national language. Language is determined with a text identifier, e.g. "en", "de", "ru" etc. - see Fully supported languages in the PROMOTIC system. See the "PmaRoot > Application > Main language of runtime" configurator.
pEvent.Enabled - (Boolean) [for read and write] Specifies whether the required action is performed over the selected alarm item or not.
true (default) - Alarm system performs the selected action over the selected alarm item.
false - Alarm system doesn't perform the selected action over the selected alarm item.
See also:
Example:
We will write every change of each item connected with the logged-in user into the Debug item of the INFO system:
JavaScriptVBScriptSelect and copy to clipboard

Pm.Debug("Alarm - Action=" + pEvent.Action + ", itemId=" + pEvent.ItemId + ", -> user=" + pEvent.Context.User.Id + ", Time=" + Now());


Obtains the name of confirmed item of the PmaData object having ExtAlarmBinary Data extensions. Also the name of the logged on user that confirmed such alarm item.
JavaScriptVBScriptSelect and copy to clipboard

var sVarName, sUserName;
var oItem = pMe.Item(pEvent.ItemId);
var oExt = oItem.Extension();

if (oExt)
{
sVarName = oExt.Var.Name;
sUserName = pEvent.Context.User.Name;
}
PROMOTIC 9.0.23 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.