Skip to main content

Ens.Alerting.ManagedAlert

persistent class Ens.Alerting.ManagedAlert extends %Library.Persistent, %XML.Adaptor, Ens.Util.BitmapPurge

SQL Table Name: Ens_Alerting.ManagedAlert

Class to provide the basic infrastructure for managing and tracking Alerts that occur in productions.

Property Inventory

Method Inventory

Parameters

parameter VALIDATEACTION = 1;
Parameter to control whether the pAction parameter passed to the Update()() is explicitly validated against the Ens.DataType.ManagedAlertAction datatype. Users should override this setting if they extend this class and need to add their own actions. Note that InterSystems IRIS reserves all action values up to and including 512 (i.e. 2^9), so any user-defined actions should start with bit 10 (i.e. 1024).

Properties

property Actions as list of Ens.Alerting.Action (STORAGEDEFAULT = "array");
The history of all previous actions that have been performed on this ManagedAlert.
Property methods: ActionsBuildValueArray(), ActionsCollectionToDisplay(), ActionsCollectionToOdbc(), ActionsDisplayToCollection(), ActionsGet(), ActionsGetObject(), ActionsGetObjectId(), ActionsGetStored(), ActionsGetSwizzled(), ActionsIsValid(), ActionsOdbcToCollection(), ActionsSet(), ActionsSetObject(), ActionsSetObjectId()
property AlertGroups as %String (MAXLEN = 2500);
The AlertGroups which should be used to determine where notifications should be sent.
Property methods: AlertGroupsDisplayToLogical(), AlertGroupsGet(), AlertGroupsGetStored(), AlertGroupsIsValid(), AlertGroupsLogicalToDisplay(), AlertGroupsLogicalToOdbc(), AlertGroupsNormalize(), AlertGroupsSet()
property AlertText as %String);
The text of the original Alert.
Property methods: AlertTextDisplayToLogical(), AlertTextGet(), AlertTextGetStored(), AlertTextIsValid(), AlertTextLogicalToDisplay(), AlertTextLogicalToOdbc(), AlertTextNormalize(), AlertTextSet()
property AlertTime as Ens.DataType.UTC [ Required ];
The time the original Alert was triggered.
Property methods: AlertTimeDisplayToLogical(), AlertTimeGet(), AlertTimeGetStored(), AlertTimeIsValid(), AlertTimeLogicalToDisplay(), AlertTimeLogicalToOdbc(), AlertTimeNormalize(), AlertTimeOdbcToLogical(), AlertTimeSet(), AlertTimeStorageToLogical(), AlertTimetimeCmp(), AlertTimetimeDiff(), AlertTimetimeLocal(), AlertTimetimeLocaltoUTC(), AlertTimetimeUTC(), AlertTimetimeUTCH(), AlertTimetimeUTCHtoUTC(), AlertTimetimeUTCtoLocal(), AlertTimetimeUTCtoUTCH()
property BusinessPartner as %String (MAXLEN = 128);
The name of the Business Partner associated with the source of the alert.
Property methods: BusinessPartnerDisplayToLogical(), BusinessPartnerGet(), BusinessPartnerGetStored(), BusinessPartnerIsValid(), BusinessPartnerLogicalToDisplay(), BusinessPartnerLogicalToOdbc(), BusinessPartnerNormalize(), BusinessPartnerSet()
property CurrentOwner as %String (MAXLEN = 256);
The user currently responsible for the ManagedAlert.
Property methods: CurrentOwnerDisplayToLogical(), CurrentOwnerGet(), CurrentOwnerGetStored(), CurrentOwnerIsValid(), CurrentOwnerLogicalToDisplay(), CurrentOwnerLogicalToOdbc(), CurrentOwnerNormalize(), CurrentOwnerSet()
property EscalationLevel as %Integer [ InitialExpression = 0 ];
The escalation level of the ManagedAlert. This can be increased manually or be raised after no activity takes place within a user-defined period of time.
Property methods: EscalationLevelDisplayToLogical(), EscalationLevelGet(), EscalationLevelGetStored(), EscalationLevelIsValid(), EscalationLevelLogicalToDisplay(), EscalationLevelNormalize(), EscalationLevelSet(), EscalationLevelXSDToLogical()
property IsOpen as %Boolean [ InitialExpression = 1 , Required ];
Flag to indicate whether the ManagedAlert is open or closed.
Property methods: IsOpenDisplayToLogical(), IsOpenGet(), IsOpenGetStored(), IsOpenIsValid(), IsOpenLogicalToDisplay(), IsOpenLogicalToXSD(), IsOpenNormalize(), IsOpenSet(), IsOpenXSDToLogical()
property LastActionTime as Ens.DataType.UTC [ Calculated ];
Calculated property to dynamically determine the last time an action occurred for this ManagedAlert.
Property methods: LastActionTimeCompute(), LastActionTimeDisplayToLogical(), LastActionTimeLogicalToDisplay(), LastActionTimeLogicalToOdbc(), LastActionTimeNormalize(), LastActionTimeOdbcToLogical(), LastActionTimeSQLCompute(), LastActionTimeStorageToLogical(), LastActionTimetimeCmp(), LastActionTimetimeDiff(), LastActionTimetimeLocal(), LastActionTimetimeLocaltoUTC(), LastActionTimetimeUTC(), LastActionTimetimeUTCH(), LastActionTimetimeUTCHtoUTC(), LastActionTimetimeUTCtoLocal(), LastActionTimetimeUTCtoUTCH()
property NextActionTime as Ens.DataType.UTC;
The time before which an action should occur for this ManagedAlert.
Property methods: NextActionTimeDisplayToLogical(), NextActionTimeGet(), NextActionTimeGetStored(), NextActionTimeIsValid(), NextActionTimeLogicalToDisplay(), NextActionTimeLogicalToOdbc(), NextActionTimeNormalize(), NextActionTimeOdbcToLogical(), NextActionTimeSet(), NextActionTimeStorageToLogical(), NextActionTimetimeCmp(), NextActionTimetimeDiff(), NextActionTimetimeLocal(), NextActionTimetimeLocaltoUTC(), NextActionTimetimeUTC(), NextActionTimetimeUTCH(), NextActionTimetimeUTCHtoUTC(), NextActionTimetimeUTCtoLocal(), NextActionTimetimeUTCtoUTCH()
property NextMonitorTime as Ens.DataType.UTC [ ReadOnly ];
The next time the Alert Monitor should check the status of this ManagedAlert. This is calculated automatically using the following logic:
  • If a user is updating an alert, and doesn't change the NextActionTime, no change will be made. (This ensures the monitor schedule is regular.)
  • If NextActionTime is in the future, then that time will be used.
  • If NextActionTime is in the past (i.e. an action is overdue), then the production's Alert Action Window setting will be used to calculate the time the Alert Monitor should check the ManagedAlert.
Property methods: NextMonitorTimeCompute(), NextMonitorTimeDisplayToLogical(), NextMonitorTimeGet(), NextMonitorTimeGetStored(), NextMonitorTimeIsValid(), NextMonitorTimeLogicalToDisplay(), NextMonitorTimeLogicalToOdbc(), NextMonitorTimeNormalize(), NextMonitorTimeOdbcToLogical(), NextMonitorTimeSQLCompute(), NextMonitorTimeSetT(), NextMonitorTimeStorageToLogical(), NextMonitorTimetimeCmp(), NextMonitorTimetimeDiff(), NextMonitorTimetimeLocal(), NextMonitorTimetimeLocaltoUTC(), NextMonitorTimetimeUTC(), NextMonitorTimetimeUTCH(), NextMonitorTimetimeUTCHtoUTC(), NextMonitorTimetimeUTCtoLocal(), NextMonitorTimetimeUTCtoUTCH()
property Production as %String (MAXLEN = 128);
The name of the production in which the original Alert was triggered.
Property methods: ProductionDisplayToLogical(), ProductionGet(), ProductionGetStored(), ProductionIsValid(), ProductionLogicalToDisplay(), ProductionLogicalToOdbc(), ProductionNormalize(), ProductionSet()
property SessionId as %Integer;
The session in which the Alert occurred.
Property methods: SessionIdDisplayToLogical(), SessionIdGet(), SessionIdGetStored(), SessionIdIsValid(), SessionIdLogicalToDisplay(), SessionIdNormalize(), SessionIdSet(), SessionIdXSDToLogical()
property SourceConfigName as %String (MAXLEN = 128);
The config item that triggered the original Alert.
Property methods: SourceConfigNameDisplayToLogical(), SourceConfigNameGet(), SourceConfigNameGetStored(), SourceConfigNameIsValid(), SourceConfigNameLogicalToDisplay(), SourceConfigNameLogicalToOdbc(), SourceConfigNameNormalize(), SourceConfigNameSet()

Methods

classmethod AlertGroupsBuildValueArray(pAlertGroups As %String = "", Output pValueArray As %String) as %Status
Helper method to allow the individual values in AlertGroups to be indexed.
classmethod BulkClose(Output pClosedCount As %Integer, ByRef pErrors As %Integer = 0, pDaysToKeep As %Integer = 30, pReason As %String = "", pConfigName As %String = "", pCurrentOwner As %String = -1, pText As %String = "") as %Status
API to make it easier to mark some large set of managed alerts as closed. The arguments that control which specific alerts are closed are as follows:
  • pErrors - flag to control whether the IDs that aren't removed are reported in subscripts of the pErrors variable on output. By default only the count is reported in pErrors.
  • pDaysToKeep - flag to control the time window that should be closed using the same logic as purges. All managed alerts that occurred more than pDaysToKeep days in the past will be closed. The flag supports a value of -1 to ensure that ALL matching managed alerts are closed, including any that were created in the past day.
  • pReason - A required string to indicate why the managed alerts are being closed.
  • pConfigName - An optional string to specify that managed alerts from a specific SourceConfigName should be closed.
  • pCurrentOwner - An optional string to specify that managed alerts assigned to the specified user should be closed. The default of -1 indicates no filter should be applied, as the empty string ("") is used to indicate that the managed alert is unassigned.
  • pText - An optional string to filter the results by specific text. By default, the filter checks whether the AlertText property contains pText ignoring case. To use an equality filter, the first character of pText should be specified as "=", and the remainder of pText will be matched against the AlertText property.
    NOTE: searches matching on AlertText may be very slow if no other filters are supplied.
classmethod ComputeNextMonitorTime(pNextActionTime As Ens.DataType.UTC) as Ens.DataType.UTC
Helper method to return a valid NextMonitorTime value. If pNextActionTime is in the future, then pNextActionTime is returned. Otherwise, the production's Alert Action Window setting is used to calculate the next time.
classmethod Create(pAlertRequest As Ens.AlertRequest = "", pProduction As %String = "", pOwner As %String = "", Output pStatus As %Status) as Ens.Alerting.ManagedAlert
Helper method to create a ManagedAlert based on the contents of an Ens.AlertRequest instance.
classmethod GetLastActionTime(pID As %Integer) as Ens.DataType.UTC
Accessor method for LastActionTime that can be invoked from SQL. The method uses the same approach as LastActionTimeGet()(), just in SQL.
method GetNextActionTime(Output pStatus As %Status) as Ens.DataType.UTC
Calculate the next action time for the Managed Alert.
classmethod GetProperties(Output pProperties As %List, Output pCollectionProperties As %List) as %Status
Helper method to populate which values are available for display in the UI. The tree structure for pProperties should be as follows:
pProperties = $listbuild([names of properties])
pProperties([propName]) = $listbuild([Property Title],[Editable],[Action Value],[Datatype],[Empty Value],[Use Display Value])
The tree structure for pCollectionProperties is as follows:
pCollectionProperties = $listbuild([names of collection properties])
pCollectionProperties([collectionName]) = $listbuild([Collection Title],[Editable],[Action Value],[Instance Title],$listbuild([list of sub-properties to display]))
pCollectionProperties([collectionName],[propName]) = $listbuild([Property Title],[Editable],[Action Value],[Datatype],[Empty Value],[Use Display Value])
method LastActionTimeGet() as Ens.DataType.UTC
Accessor method for LastActionTime. It simply gets the ActionTime from the most recent action in Actions, and the value of AlertTime if no actions have been logged.
method OnUpdateAlert(pActionValue As Ens.DataType.ManagedAlertAction, ByRef pNewValues As %String, pActionObject As Ens.Alerting.Action) as %Status
User callback invoked from UpdateAlert()() to allow users to specify extended action types and extra values.
classmethod Purge(Output pDeletedCount As %Integer, pDaysToKeep As %Integer = 7, pKeepIntegrity As %Boolean = 1, pBitmapChunkLimit As %Integer = 500) as %Status
method UpdateAlert(pAction As Ens.DataType.ManagedAlertAction, ByRef pNewValues As %String, pReason As %String = "") as %Status
Method to update a Managed Alert. The arguments are as follows:
  • pAction - The bits indicating what actions should take place.
  • pNewValues - An array of the new values to set subscripted by property name.
  • pReason - A required string to indicate why the action is being taken.
classmethod UpdateManagedAlert(pID As %Integer = "", pAction As Ens.DataType.ManagedAlertAction, ByRef pNewValues As %String, pReason As %String = "") as %Status
Helper method to invoke UpdateAlert()() when the ManagedAlert instance is not already open.
method UpdateNextMonitorTime(pSave As %Boolean = 0) as %Status
Helper method to update the value of NextMonitorTime. The code is in ComputeNextMonitorTime()(), but the logic describing when UpdateNextMonitorTime()() should be called and what value it should compute is in the documentation for the NextMonitorTime property.

Indexes

index ($ManagedAlert on ) [Extent, Type = bitmap];
index (AlertGroups on AlertGroups(ELEMENTS):Exact) [Type = bitmap];
Index methods: AlertGroupsBuildValueArray(), AlertGroupsDisplayToLogical(), AlertGroupsGet(), AlertGroupsGetStored(), AlertGroupsIsValid(), AlertGroupsLogicalToDisplay(), AlertGroupsLogicalToOdbc(), AlertGroupsNormalize(), AlertGroupsSet()
index (AlertTime on AlertTime);
Index methods: AlertTimeDisplayToLogical(), AlertTimeExists(), AlertTimeGet(), AlertTimeGetStored(), AlertTimeIsValid(), AlertTimeLogicalToDisplay(), AlertTimeLogicalToOdbc(), AlertTimeNormalize(), AlertTimeOdbcToLogical(), AlertTimeSet(), AlertTimeStorageToLogical(), AlertTimetimeCmp(), AlertTimetimeDiff(), AlertTimetimeLocal(), AlertTimetimeLocaltoUTC(), AlertTimetimeUTC(), AlertTimetimeUTCH(), AlertTimetimeUTCHtoUTC(), AlertTimetimeUTCtoLocal(), AlertTimetimeUTCtoUTCH()
index (CurrentOwner on CurrentOwner) [Type = bitmap];
Index methods: CurrentOwnerDisplayToLogical(), CurrentOwnerGet(), CurrentOwnerGetStored(), CurrentOwnerIsValid(), CurrentOwnerLogicalToDisplay(), CurrentOwnerLogicalToOdbc(), CurrentOwnerNormalize(), CurrentOwnerSet()
index (EscLevel on EscalationLevel) [Type = bitmap];
index (IDKEY on ) [IdKey, Type = key];
Index methods: IDKEYCheck(), IDKEYDelete(), IDKEYExists(), IDKEYOpen(), IDKEYSQLCheckUnique(), IDKEYSQLExists(), IDKEYSQLFindPKeyByConstraint(), IDKEYSQLFindRowIDByConstraint()
index (NextAction on IsOpen,NextActionTime);
NextAction is on both NextActionTime and IsOpen as the UI needs to identify both of these fields as cheaply as possible.
Index methods: NextActionExists(), NextActionTimeDisplayToLogical(), NextActionTimeGet(), NextActionTimeGetStored(), NextActionTimeIsValid(), NextActionTimeLogicalToDisplay(), NextActionTimeLogicalToOdbc(), NextActionTimeNormalize(), NextActionTimeOdbcToLogical(), NextActionTimeSet(), NextActionTimeStorageToLogical(), NextActionTimetimeCmp(), NextActionTimetimeDiff(), NextActionTimetimeLocal(), NextActionTimetimeLocaltoUTC(), NextActionTimetimeUTC(), NextActionTimetimeUTCH(), NextActionTimetimeUTCHtoUTC(), NextActionTimetimeUTCtoLocal(), NextActionTimetimeUTCtoUTCH()
index (NextMonitor on IsOpen,NextMonitorTime);
NextMonitor is on both NextActionTime and IsOpen as the AlertMonitor component needs to identify these fields as cheaply as possible.
Index methods: NextMonitorExists(), NextMonitorTimeCompute(), NextMonitorTimeDisplayToLogical(), NextMonitorTimeGet(), NextMonitorTimeGetStored(), NextMonitorTimeIsValid(), NextMonitorTimeLogicalToDisplay(), NextMonitorTimeLogicalToOdbc(), NextMonitorTimeNormalize(), NextMonitorTimeOdbcToLogical(), NextMonitorTimeSQLCompute(), NextMonitorTimeSetT(), NextMonitorTimeStorageToLogical(), NextMonitorTimetimeCmp(), NextMonitorTimetimeDiff(), NextMonitorTimetimeLocal(), NextMonitorTimetimeLocaltoUTC(), NextMonitorTimetimeUTC(), NextMonitorTimetimeUTCH(), NextMonitorTimetimeUTCHtoUTC(), NextMonitorTimetimeUTCtoLocal(), NextMonitorTimetimeUTCtoUTCH()
index (Open on IsOpen) [Type = bitmap];
index (Source on SourceConfigName) [Type = bitmap];
Index methods: SourceConfigNameDisplayToLogical(), SourceConfigNameGet(), SourceConfigNameGetStored(), SourceConfigNameIsValid(), SourceConfigNameLogicalToDisplay(), SourceConfigNameLogicalToOdbc(), SourceConfigNameNormalize(), SourceConfigNameSet()

Inherited Members

Inherited Methods

Storage

Storage Model: Storage (Ens.Alerting.ManagedAlert)

^Ens.Alerting.ManagedAlertD(ID,"Actions",n)
=
Actions(n)

Storage Model: Storage (Ens.Alerting.ManagedAlert)

^Ens.Alerting.ManagedAlertD(ID)
=
%%CLASSNAME
AlertTime
Production
SourceConfigName
AlertText
AlertGroups
CurrentOwner
EscalationLevel
IsOpen
NextActionTime
SessionId
BusinessPartner
NextMonitorTime
FeedbackOpens in a new tab