AlertApi

View as Markdown

Alert Definitions and fired alerts: read, edit, suspend, evaluate and display them.

TypeScript
export interface

Methods

MethodReturnsDescription
addAlertDefinition(alertDefinition)AlertDefinitionAdds given Alert Definition to Adaptable State
applyScheduledAlertDefinition(alertDefinition)voidFires a scheduled Alert Definition now: its notification, system status message, or other behaviour.
deleteAlertDefinition(alertDefinition)voidDeletes given Alert Definition from Adaptable State
displayAdaptableAlert(alertToShow)Promise<void>Displays the given Adaptable Alert.
displayAdaptableAlertNotification(alert)voidDisplays given Alert as a Toast
editAlertDefinition(alertDefinition)AlertDefinitionUpdates given Alert Definition in Adaptable State
evaluateAlertDefinitions(alertDefinitions)voidEvaluates the given Alert Definitions - will fire Alert if rule is met
findAlertDefinitions(alertLookupCriteria)AlertDefinition[]Find all Alert Definitions which match the given criteria
getActiveAlertDefinitions()AlertDefinition[]Alert Definitions that are currently active (not suspended).
getAlertDefinitionById(id)AlertDefinitionRetrieves alert definition by the technical ID (from AlertState)
getAlertDefinitionByName(name)AlertDefinition | undefinedRetrieves an Alert Definition by its Name
getAlertDefinitions()AlertDefinition[]Retrieves all Alert Definitions in Alert State
getAlertRuleState(alertDefinition, rowNode)'Normal' | 'Firing' | undefinedCurrent reading of a live Alert rule — one reading change history
(CHANGE_COUNT{[price], WITHIN(5m)} >= 3) or the clock. 'Firing' while
the rule holds for rowNode (per-row rules) or for the grid (grid-level
rules; rowNode ignored); 'Normal' otherwise. undefined for
non-live, suspended or never-evaluated definitions / rows.
getAlertState()AlertStateRetrieves Alert section from Adaptable State
getSuspendedAlertDefinitions()AlertDefinition[]Alert Definitions that are currently suspended.
openAlertSettingsPanel(tab)voidOpens the Settings Panel on the Alert page.

The Alert page has two tabs: 'Alerts' (the live / triggered alerts) and
'Alert Definitions' (the alert configuration). Pass tab to open a specific tab.
When omitted, it opens the 'Alerts' tab if there are any live alerts, otherwise the
'Alert Definitions' tab.
showAlert(alertHeader, alertMessage, messageType, alertProperties)Promise<void>Creates Alert based on given parameters and displays it.
showAlertError(alertHeader, alertMessage)Promise<void>Creates an Adaptable Alert based on given parameters and displays it as Error Alert.
showAlertInfo(alertHeader, alertMessage)Promise<void>Creates an Adaptable Alert based on given parameters and displays it as Info Alert.
showAlertSuccess(alertHeader, alertMessage)Promise<void>Creates an Adaptable Alert from the header and message and displays it as a Success alert.
showAlertWarning(alertHeader, alertMessage)Promise<void>Creates an Adaptable Alert based on given parameters and displays it as Warning Alert.
suspendAlertDefinition(alertDefinition)AlertDefinitionSuspends Alert Definition
suspendAllAlertDefinition()voidSuspends all Alert Definitions
unSuspendAlertDefinition(alertDefinition)AlertDefinitionActivates a suspended Alert Definition
unSuspendAllAlertDefinition()voidActivates all suspended Alert Definition

Method Details

addAlertDefinition

Adds given Alert Definition to Adaptable State

TypeScript
addAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;
Parameters
ParameterTypeDescription
alertDefinitionAlertDefinitionAlertDefinition to add
Returns

alert definition

AlertDefinition

applyScheduledAlertDefinition

Fires a scheduled Alert Definition now: its notification, system status message, or other behaviour.

TypeScript
applyScheduledAlertDefinition(alertDefinition: AlertDefinition): void;
Parameters
ParameterTypeDescription
alertDefinitionAlertDefinitionScheduled Alert Definition to run
Returns

void

deleteAlertDefinition

Deletes given Alert Definition from Adaptable State

TypeScript
deleteAlertDefinition(alertDefinition: AlertDefinition): void;
Parameters
ParameterTypeDescription
alertDefinitionAlertDefinitionAlert Definition to delete
Returns

void

displayAdaptableAlert

Displays the given Adaptable Alert.

TypeScript
displayAdaptableAlert(alertToShow: AdaptableAlert): Promise<void>;
Parameters
ParameterTypeDescription
alertToShowAdaptableAlertThe alert to display
Returns

Promise<void>

displayAdaptableAlertNotification

Displays given Alert as a Toast

TypeScript
displayAdaptableAlertNotification(alert: AdaptableAlert): void;
Parameters
ParameterTypeDescription
alertAdaptableAlertthe Alert to show as a Toast
Returns

void

editAlertDefinition

Updates given Alert Definition in Adaptable State

TypeScript
editAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;
Parameters
ParameterTypeDescription
alertDefinitionAlertDefinitionAlert to Edit
Returns

alert definition

AlertDefinition

evaluateAlertDefinitions

Evaluates the given Alert Definitions - will fire Alert if rule is met

TypeScript
evaluateAlertDefinitions(alertDefinitions: AlertDefinition[]): void;
Parameters
ParameterTypeDescription
alertDefinitionsAlertDefinition[]Alert Definitions to evaluate
Returns

void

findAlertDefinitions

Find all Alert Definitions which match the given criteria

TypeScript
findAlertDefinitions(alertLookupCriteria: AdaptableObjectLookupCriteria): AlertDefinition[];
Parameters
ParameterTypeDescription
alertLookupCriteriaAdaptableObjectLookupCriteriaIds, names or other properties to match
Returns

Every Alert Definition that matches

AlertDefinition[]

getActiveAlertDefinitions

Alert Definitions that are currently active (not suspended).

TypeScript
getActiveAlertDefinitions(): AlertDefinition[];
Returns

The active definitions

AlertDefinition[]

getAlertDefinitionById

Retrieves alert definition by the technical ID (from AlertState)

TypeScript
getAlertDefinitionById(id: AlertDefinition['Uuid']): AlertDefinition;
Parameters
ParameterTypeDescription
idAlertDefinition['Uuid']alert definition id
Returns

alert definition

AlertDefinition

getAlertDefinitionByName

Retrieves an Alert Definition by its Name

TypeScript
getAlertDefinitionByName(name: string): AlertDefinition | undefined;
Parameters
ParameterTypeDescription
namestringName of the Alert Definition
Returns

Alert Definition or undefined if not found

AlertDefinition | undefined

getAlertDefinitions

Retrieves all Alert Definitions in Alert State

TypeScript
getAlertDefinitions(): AlertDefinition[];
Returns

alert definitions

AlertDefinition[]

getAlertRuleState

Current reading of a live Alert rule — one reading change history (CHANGE_COUNT{[price], WITHIN(5m)} >= 3) or the clock. 'Firing' while the rule holds for rowNode (per-row rules) or for the grid (grid-level rules; rowNode ignored); 'Normal' otherwise. undefined for non-live, suspended or never-evaluated definitions / rows.

TypeScript
getAlertRuleState(alertDefinition: AlertDefinition, rowNode?: IRowNode): 'Normal' | 'Firing' | undefined;
Parameters
ParameterTypeDescription
alertDefinitionAlertDefinitionthe live Alert Definition
rowNodeIRowNodethe row, for per-row rules
Returns

'Firing' while the rule holds, 'Normal' when it does not, or undefined when the definition is not live, is suspended, or has not been evaluated

'Normal' | 'Firing' | undefined

getAlertState

Retrieves Alert section from Adaptable State

TypeScript
getAlertState(): AlertState;
Returns

alert state

AlertState

getSuspendedAlertDefinitions

Alert Definitions that are currently suspended.

TypeScript
getSuspendedAlertDefinitions(): AlertDefinition[];
Returns

The suspended definitions

AlertDefinition[]

openAlertSettingsPanel

Opens the Settings Panel on the Alert page.

The Alert page has two tabs: 'Alerts' (the live / triggered alerts) and 'Alert Definitions' (the alert configuration). Pass tab to open a specific tab. When omitted, it opens the 'Alerts' tab if there are any live alerts, otherwise the 'Alert Definitions' tab.

TypeScript
openAlertSettingsPanel(tab?: AlertSettingsPanelTab): void;
Parameters
ParameterTypeDescription
tabAlertSettingsPanelTabTab to open. Omit it to open 'Alerts' when live alerts exist, otherwise 'Alert Definitions'
Returns

void

showAlert

Creates Alert based on given parameters and displays it.

TypeScript
showAlert(alertHeader: string, alertMessage: string, messageType: AdaptableMessageType, alertProperties?: AlertPresentationProperties): Promise<void>;
Parameters
ParameterTypeDescription
alertHeaderstringHeader of the Alert. When the alert is a popup, this is the window title
alertMessagestringMain message of the alert
messageTypeAdaptableMessageTypeSuccess, Info, Warning or Error
alertPropertiesAlertPresentationPropertiesHow the alert is presented: notification, popup, or both
Returns

Promise<void>

showAlertError

Creates an Adaptable Alert based on given parameters and displays it as Error Alert.

TypeScript
showAlertError(alertHeader: string, alertMessage: string): Promise<void>;
Parameters
ParameterTypeDescription
alertHeaderstringHeader of the Alert (if shown in a popup its the Title of the Window)
alertMessagestringMain message of the alert
Returns

Promise<void>

showAlertInfo

Creates an Adaptable Alert based on given parameters and displays it as Info Alert.

TypeScript
showAlertInfo(alertHeader: string, alertMessage: string): Promise<void>;
Parameters
ParameterTypeDescription
alertHeaderstringHeader of the Alert (if shown in a popup its the Title of the Window)
alertMessagestringMain message of the alert
Returns

Promise<void>

showAlertSuccess

Creates an Adaptable Alert from the header and message and displays it as a Success alert.

TypeScript
showAlertSuccess(alertHeader: string, alertMessage: string): Promise<void>;
Parameters
ParameterTypeDescription
alertHeaderstringHeader of the Alert (if shown in a popup its the Title of the Window)
alertMessagestringMain message of the alert
Returns

Promise<void>

showAlertWarning

Creates an Adaptable Alert based on given parameters and displays it as Warning Alert.

TypeScript
showAlertWarning(alertHeader: string, alertMessage: string): Promise<void>;
Parameters
ParameterTypeDescription
alertHeaderstringHeader of the Alert (if shown in a popup its the Title of the Window)
alertMessagestringMain message of the alert
Returns

Promise<void>

suspendAlertDefinition

Suspends Alert Definition

TypeScript
suspendAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;
Parameters
ParameterTypeDescription
alertDefinitionAlertDefinitionAlert Definition to suspend
Returns

The suspended Alert Definition

AlertDefinition

suspendAllAlertDefinition

Suspends all Alert Definitions

TypeScript
suspendAllAlertDefinition(): void;
Returns

void

unSuspendAlertDefinition

Activates a suspended Alert Definition

TypeScript
unSuspendAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;
Parameters
ParameterTypeDescription
alertDefinitionAlertDefinitionAlert to Un-suspend (activate)
Returns

alert definition

AlertDefinition

unSuspendAllAlertDefinition

Activates all suspended Alert Definition

TypeScript
unSuspendAllAlertDefinition(): void;
Returns

void