Top  | Previous | Next

system.alert.acknowledgeAlert

Description

Acknowledges an alert, as specified by a system, path, and stateName. When run in a Client script, the currently logged-in user will be recorded as having acknowledged the alert. When run in a Gateway script, you must provide a username that will be recorded with the acknowledgement, since no user actually acknowledged the alert.

Syntax

system.alert.acknowledgeAlert(system, path, stateName)

Parameters

String system - The originating system for the alert being acknowledged.

String path - The path to the alert being acknowledged.

String stateName - The alert state name to acknowledge.

Returns

nothing

Scope

Client

system.alert.acknowledgeAlert(system, path, stateName, user)

Parameters

String system - The originating system for the alert being acknowledged.

String path - The path to the alert being acknowledged.

String stateName - The alert state name to acknowledge.

String user - A username to use for who acknowledged this alert. Only available in the Gateway-scoped version of this function.

Returns

nothing

Scope

Gateway

Examples

This example shows the basic syntax for acknowledging an alert.

 

system.alert.acknowledgeAlert("SQLTags.default""[default]Alm_ESTOP""ALM_STOP")

 

This code snippet could be used as a mouseReleased event handler on a Table component whose data was the return value of the system.alert.queryAlertStatus function. It would present a right-click menu to acknowledge the currently selected alert.

 

row = event.source.selectedRow

if row != -1:

   data = event.source.data

   alertSys = data.getValueAt(row,"System")

   alertPath = data.getValueAt(row,"Path")

   alertState = data.getValueAt(row,"State Name")

   def ack(event, aSys=alertSys, aPath=alertPath, aState=alertState):

      import system

      system.alert.acknowledgeAlert(aSys,aPath,aState)

 

   menu = system.gui.createPopupMenu({"Acknowledge":ack})

   menu.show(event)

 

See also:

Event Types / Mouse Events

system.alert.queryAlertStatus

system.gui.createPopupMenu