AlertApi
Alert Definitions and fired alerts: read, edit, suspend, evaluate and display them.
export interfaceMethods
| Method | Returns | Description |
|---|---|---|
| addAlertDefinition(alertDefinition) | AlertDefinition | Adds given Alert Definition to Adaptable State |
| applyScheduledAlertDefinition(alertDefinition) | void | Fires a scheduled Alert Definition now: its notification, system status message, or other behaviour. |
| deleteAlertDefinition(alertDefinition) | void | Deletes given Alert Definition from Adaptable State |
| displayAdaptableAlert(alertToShow) | Promise<void> | Displays the given Adaptable Alert. |
| displayAdaptableAlertNotification(alert) | void | Displays given Alert as a Toast |
| editAlertDefinition(alertDefinition) | AlertDefinition | Updates given Alert Definition in Adaptable State |
| evaluateAlertDefinitions(alertDefinitions) | void | Evaluates 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) | AlertDefinition | Retrieves alert definition by the technical ID (from AlertState) |
| getAlertDefinitionByName(name) | AlertDefinition | undefined | Retrieves an Alert Definition by its Name |
| getAlertDefinitions() | AlertDefinition[] | Retrieves all Alert Definitions in Alert State |
| getAlertRuleState(alertDefinition, rowNode) | 'Normal' | 'Firing' | undefined | Current reading of a live Alert rule — one reading change history ( CHANGE_COUNT{[price], WITHIN(5m)} >= 3) or the clock. 'Firing' whilethe rule holds for rowNode (per-row rules) or for the grid (grid-levelrules; rowNode ignored); 'Normal' otherwise. undefined fornon-live, suspended or never-evaluated definitions / rows. |
| getAlertState() | AlertState | Retrieves Alert section from Adaptable State |
| getSuspendedAlertDefinitions() | AlertDefinition[] | Alert Definitions that are currently suspended. |
| openAlertSettingsPanel(tab) | void | 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. |
| 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) | AlertDefinition | Suspends Alert Definition |
| suspendAllAlertDefinition() | void | Suspends all Alert Definitions |
| unSuspendAlertDefinition(alertDefinition) | AlertDefinition | Activates a suspended Alert Definition |
| unSuspendAllAlertDefinition() | void | Activates all suspended Alert Definition |
Method Details
addAlertDefinition
Adds given Alert Definition to Adaptable State
addAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertDefinition | AlertDefinition | AlertDefinition to add |
Returns
alert definition
applyScheduledAlertDefinition
Fires a scheduled Alert Definition now: its notification, system status message, or other behaviour.
applyScheduledAlertDefinition(alertDefinition: AlertDefinition): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertDefinition | AlertDefinition | Scheduled Alert Definition to run |
Returns
void
deleteAlertDefinition
Deletes given Alert Definition from Adaptable State
deleteAlertDefinition(alertDefinition: AlertDefinition): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertDefinition | AlertDefinition | Alert Definition to delete |
Returns
void
displayAdaptableAlert
Displays the given Adaptable Alert.
displayAdaptableAlert(alertToShow: AdaptableAlert): Promise<void>;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertToShow | AdaptableAlert | The alert to display |
Returns
Promise<void>
displayAdaptableAlertNotification
Displays given Alert as a Toast
displayAdaptableAlertNotification(alert: AdaptableAlert): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| alert | AdaptableAlert | the Alert to show as a Toast |
Returns
void
editAlertDefinition
Updates given Alert Definition in Adaptable State
editAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertDefinition | AlertDefinition | Alert to Edit |
Returns
alert definition
evaluateAlertDefinitions
Evaluates the given Alert Definitions - will fire Alert if rule is met
evaluateAlertDefinitions(alertDefinitions: AlertDefinition[]): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertDefinitions | AlertDefinition[] | Alert Definitions to evaluate |
Returns
void
findAlertDefinitions
Find all Alert Definitions which match the given criteria
findAlertDefinitions(alertLookupCriteria: AdaptableObjectLookupCriteria): AlertDefinition[];Parameters
| Parameter | Type | Description |
|---|---|---|
| alertLookupCriteria | AdaptableObjectLookupCriteria | Ids, names or other properties to match |
Returns
Every Alert Definition that matches
getActiveAlertDefinitions
Alert Definitions that are currently active (not suspended).
getActiveAlertDefinitions(): AlertDefinition[];Returns
The active definitions
getAlertDefinitionById
Retrieves alert definition by the technical ID (from AlertState)
getAlertDefinitionById(id: AlertDefinition['Uuid']): AlertDefinition;Parameters
| Parameter | Type | Description |
|---|---|---|
| id | AlertDefinition['Uuid'] | alert definition id |
Returns
alert definition
getAlertDefinitionByName
Retrieves an Alert Definition by its Name
getAlertDefinitionByName(name: string): AlertDefinition | undefined;Parameters
| Parameter | Type | Description |
|---|---|---|
| name | string | Name of the Alert Definition |
Returns
Alert Definition or undefined if not found
AlertDefinition | undefined
getAlertDefinitions
Retrieves all Alert Definitions in Alert State
getAlertDefinitions(): AlertDefinition[];Returns
alert definitions
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.
getAlertRuleState(alertDefinition: AlertDefinition, rowNode?: IRowNode): 'Normal' | 'Firing' | undefined;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertDefinition | AlertDefinition | the live Alert Definition |
| rowNode | IRowNode | the 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
getAlertState(): AlertState;Returns
alert state
getSuspendedAlertDefinitions
Alert Definitions that are currently suspended.
getSuspendedAlertDefinitions(): AlertDefinition[];Returns
The suspended definitions
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.
openAlertSettingsPanel(tab?: AlertSettingsPanelTab): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| tab | AlertSettingsPanelTab | Tab 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.
showAlert(alertHeader: string, alertMessage: string, messageType: AdaptableMessageType, alertProperties?: AlertPresentationProperties): Promise<void>;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertHeader | string | Header of the Alert. When the alert is a popup, this is the window title |
| alertMessage | string | Main message of the alert |
| messageType | AdaptableMessageType | Success, Info, Warning or Error |
| alertProperties | AlertPresentationProperties | How 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.
showAlertError(alertHeader: string, alertMessage: string): Promise<void>;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertHeader | string | Header of the Alert (if shown in a popup its the Title of the Window) |
| alertMessage | string | Main message of the alert |
Returns
Promise<void>
showAlertInfo
Creates an Adaptable Alert based on given parameters and displays it as Info Alert.
showAlertInfo(alertHeader: string, alertMessage: string): Promise<void>;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertHeader | string | Header of the Alert (if shown in a popup its the Title of the Window) |
| alertMessage | string | Main message of the alert |
Returns
Promise<void>
showAlertSuccess
Creates an Adaptable Alert from the header and message and displays it as a Success alert.
showAlertSuccess(alertHeader: string, alertMessage: string): Promise<void>;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertHeader | string | Header of the Alert (if shown in a popup its the Title of the Window) |
| alertMessage | string | Main message of the alert |
Returns
Promise<void>
showAlertWarning
Creates an Adaptable Alert based on given parameters and displays it as Warning Alert.
showAlertWarning(alertHeader: string, alertMessage: string): Promise<void>;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertHeader | string | Header of the Alert (if shown in a popup its the Title of the Window) |
| alertMessage | string | Main message of the alert |
Returns
Promise<void>
suspendAlertDefinition
Suspends Alert Definition
suspendAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertDefinition | AlertDefinition | Alert Definition to suspend |
Returns
The suspended Alert Definition
suspendAllAlertDefinition
Suspends all Alert Definitions
suspendAllAlertDefinition(): void;Returns
void
unSuspendAlertDefinition
Activates a suspended Alert Definition
unSuspendAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition;Parameters
| Parameter | Type | Description |
|---|---|---|
| alertDefinition | AlertDefinition | Alert to Un-suspend (activate) |
Returns
alert definition
unSuspendAllAlertDefinition
Activates all suspended Alert Definition
unSuspendAllAlertDefinition(): void;Returns
void