Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [Ens] >  [Alerting] >  [ManagedAlert]
Private  Storage   

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

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

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 15 15 8


Summary

Properties
Actions AlertGroups AlertText AlertTime
BusinessPartner CurrentOwner EscalationLevel IsOpen
LastActionTime NextActionTime NextMonitorTime Production
SessionId SourceConfigName

Methods
%AddToSaveSet %AddToSyncSet %BMEBuilt %CheckConstraints
%CheckConstraintsForExtent %ClassIsLatestVersion %ClassName %ComposeOid
%ConstructClone %Delete %DeleteExtent %DeleteId
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Exists
%ExistsId %Extends %GUID %GUIDSet
%GetLock %GetParameter %GetSwizzleObject %Id
%InsertBatch %IsA %IsModified %IsNull
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PhysicalAddress %PurgeIndices %Reload %RemoveFromSaveSet
%ResolveConcurrencyConflict %RollBack %Save %SaveDirect
%SaveIndices %SerializeObject %SetModified %SortBegin
%SortEnd %SyncObjectIn %SyncTransport %UnlockExtent
%UnlockId %ValidateIndices %ValidateObject AlertGroupsBuildValueArray
BulkClose ComputeNextMonitorTime Create GetLastActionTime
GetNextActionTime GetProperties LastActionTimeGet OnUpdateAlert
Purge PurgeBitmaps UpdateAlert UpdateManagedAlert
UpdateNextMonitorTime XMLDTD XMLExport XMLExportToStream
XMLExportToString XMLNew XMLSchema XMLSchemaNamespace
XMLSchemaType


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 AlertGroups as %String(MAXLEN=2500);
The AlertGroups which should be used to determine where notifications should be sent.
• property AlertText as %String(MAXLEN="");
The text of the original Alert.
• property AlertTime as Ens.DataType.UTC [ Required ];
The time the original Alert was triggered.
• property BusinessPartner as %String(MAXLEN=128);
The name of the Business Partner associated with the source of the alert.
• property CurrentOwner as %String(MAXLEN=256);
The user currently responsible for the ManagedAlert.
• 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 IsOpen as %Boolean [ InitialExpression = 1,Required ];
Flag to indicate whether the ManagedAlert is open or closed.
• property LastActionTime as Ens.DataType.UTC [ Calculated ];
Calculated property to dynamically determine the last time an action occurred for this ManagedAlert.
• property NextActionTime as Ens.DataType.UTC;
The time before which an action should occur for this ManagedAlert.
• 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 Production as %String(MAXLEN=128);
The name of the production in which the original Alert was triggered.
• property SessionId as %Integer;
The session in which the Alert occurred.
• property SourceConfigName as %String(MAXLEN=128);
The config item that triggered the original Alert.

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.

Indices

•index (AlertGroups on AlertGroups(ELEMENTS):Exact) [Type = bitmap];
•index (AlertTime on AlertTime);
•index (CurrentOwner on CurrentOwner) [Type = bitmap];
•index (EscLevel on EscalationLevel) [Type = bitmap];
•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 (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 (Open on IsOpen) [Type = bitmap];
•index (Source on SourceConfigName) [Type = bitmap];


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.