Displaying Alerts

Summary

  • AdapTable facilitates the creation of powerful and flexible Alerts
  • Alerts are fired when the Rule specified in an Alert Definition is met
  • This is typically the result of Data Changes in AG Grid - either a user edit or ticking data
  • An Alert Rule can be either:
    • a Predicate
    • an Expression (either Boolean, Observable or Aggregation Boolean)
  • All Alerts have a Message Type and an accompanying Message
  • Once triggered, there are many options available for how the Alert should behave

Alerts are one of the most popular and powerful functionalities offered by AdapTable.

AdapTable provides 5 different types of Alerts, each with many, rich, options to help users control how to trigger, react to, and render each Alert.

Alert Rule

Each Alert Definition has a Rule which defines what data change triggers the Alert.

Alert Rules can be grouped conceptually into 6 types (all are evaluated using AdapTableQL):

  • Data Change
  • Relative Change
  • Row Change
  • Observable
  • Aggregation
  • Validation

Data Change

Data Change Alerts are the most common type of Alert.

The Alert fires when the change in a Grid Cell value matches the Alert Rule.

The Data Change that triggers the Alert can be either a user edit or a ticking update.

Note

  • Data Change Alerts contain Column Scope - commonly used across AdapTable
  • This allows users to specify which columns (or Data Types or Column Types) will trigger Alerts when they change

Most Data Change Alerts use Predicates, a boolean function widely used in AdapTable (e.g. Column Filters).

There is no limit on how many Predicates can be provided in each Alert Definition.

Find Out More

The AdapTableQL Guide provides details on using System Predicates and creating Custom Predicates

More complex Data Change Alerts use a (Boolean) Standard Expression - (i.e. an Expression which returns true/false)

Hint

This allows the creation of Alerts which fire based not just on data changes in the cell, but other values in the row

Relative Change

Relative Change Alerts valuate on the relative nature of the change made to a given Cell's value.

Note

These Alerts leverage the ANY_CHANGE, PERCENT_CHANGE and ABSOLUTE_CHANGE Expression Functions

Row Change

Row Change Alerts fire in response to rows being added / removed in AG Grid.

Note

These Alerts leverage the ROW_ADDED and ROW_REMOVED Observable Expression Functions

Aggregation

Aggregation Alerts run against aggregated data to fire using data from more than one row.

They leverage Aggregation Expressions to enable things like Limits Analysis (e.g. to fire when the sum of the 'PnL' Column is over 50M for rows where Currency is Dollar).

Observable

Observable Alerts use Reactive (Rx) Expressions to fire in response to specified changes in AG Grid.

These changes can be in a particular row (or set of rows) or in the entire Grid.

Hint

Observable Alerts can also react to a lack of changes, i.e. if something doesnt tick in a given amount of time

Validation

Validation Alerts prevent data changes that break an Alert Rule.

The data change is rolled back before the cell edit is committed.

Alert Message Type

Each Alert has a MessageType property which influences how the Alert is rendered.

Note

This includes in the Alert Toolbar, Tool Panel, Status Bar and in any Toast Notifications

Four Message Types are available. Each has a different associated colour (configurable through CSS Variables) that is used by when rendering the Alert Notification.

Message TypeDefault Colour and CSS Variable
Info
var(--ab-color-info)
Success
var(--ab-color-success)
Warning
var(--ab-color-warn)
Error
var(--ab-color-error)

Hint

The colour returned by any of these variables can be set when creating a Custom Theme

Alert Behaviours

There are many behaviours that can be set for an Alert including:

  • Display a Notification - probably the most common Alert Behaviour: AdapTable displays a Toast Notification (with an optional Form or Action buttons) when an important Alert fires

  • Highlight the Cell (or Row) where the data changed that triggered the Alert

  • Jump to Cell so AG Grid immediately shows the row which contains the cell that triggered the Alert

  • Show the Alert details in a bespoke Div element (that you specify in Container Options)

  • Prevent the Cell Edit from happening when they break the rule set in the Alert Definition

  • Log to the Console a message detailing the Data Change and the Alert Definition

Note

Find Out More

Alert Behaviours contains more information on the Alert Behaviours available

Alert Forms

Alert Notifications can additionally include fully customisable Forms.

These are instances of Adaptable Forms (similar to those used in Custom Export Destinations) that can be configured to show bespoke form elements.

Alert Button Actions

Alert Forms can be wired so that Alert Button Actions are triggered when the Form's Button is clicked.

Caution

  • Alert Behaviours trigger when the Alert itself is fired
  • Alert Button Actions trigger when a Button in an Alert Form is clicked

AdapTable provides System Alert Button Actions which are available to end-users when creating an Alert in the AdapTable UI.

In addition developers can supply their own bespoke Custom Alert Button Actions.

Find Out More

See Providing an Alert Form for full details of these potentially complicated topics

Using Alerts

Run-time access to Alerts is available in the Alert section of the Settings Panel.

This lists all Alerts in Adaptable State together with options to Create, Edit, Delete and Suspend.

Suspending Alerts

Like most Adaptable Objects, Alerts can be suspended by clicking the toggle button in the Settings Panel.

When an Alert is suspended it is fully cancelled: no Alert Messages will be fired, no toast notifications will display and nothing will show in the Alert Toolbar and Tool Panel.

If it is a Reactive (i.e. Observable) Alert, then the subscription is removed when the Alert is suspended and will be re-created when unsuspended.

Hint

  • Set DisplayNotification to false in Alert Properties to keep the Alerts running but reduce notifications
  • Alternatively change the default notification behaviour in Notification Options

UI Entitlements

The UI Entitlements behaviour is as expected for Full and Hidden Access Levels.

The ReadOnly Entitlement behaviour is that Alerts will trigger as normal but users cannot create, edit, delete or suspend Alert Definitions; Alerts may be still cleared however.

FAQ

Can we show Alerts in the System Tray? Not directly as its not something AdapTable can easily access. But we do publish the Alert Fired Event which allows you to show the Alert in multiple places.

I don't want my Alerts to pop-up. Can I prevent that? Yes, when you create an Alert Definition you can stipulate whether the Alert will display a Notification. See Alert Initial State for the full Alert Definition.

What is the difference between the Alert and the Reminder functions? While Reminders are, indeed, similar to Alerts, there are 2 key differences:

  • Reminder message are hard-coded and not dynamically derived from the data change (as with Alerts)
  • Reminders are not triggered by Grid changes, but according to user-provided Schedules

Can I set different notification properties based on the type of Alert? No. Unlike Alert Properties which can be set independently for each Alert Definition, Toast Notifications are configured in Notification Options and so are configured identically for every Alert where you have chosen to display a notification

There are too many Alert Notifications - can we turn them off for a bit? Yes, most Adaptable Objects derive from Suspendable Object which has an IsSuspended property, enabling the object to be suspended at any time in the Settings Panel; this will stop the Alert triggering but keep the definition for when you want to turn it back on. We also provide the suspend System Alert Button Action so the User can suspend the Alerts via a Notification

AdapTable Resources