Skip to main content
Version: Current

Notify - Genesis Screen

The Genesis low-code platform provides a mechanism for creating pop-up toast notifications on screen in app. Any notifications sent to the Genesis Screen Gateway will be sent as a toast pop-up notification.

GPAL Configuration

Screen alerts must be configured in your notify.kts file. Here is an example configuration to create a screen gateway.

notify {
gateways {
screen("screen")
}

// optionally include additional connections, including Microsoft Teams connections
}

System configuration

The application must have a simple .ts file to process the alert.

Database configuration

NOTIFY_ROUTE

You need at least one NOTIFY_ROUTE entry set up to point to the GATEWAY record, so that NOTIFY records are routed as messages.

Field NameUsage
GATEWAY_IDShould match the ID given to the gateway in the notify.kts file.
NOTIFY_ROUTE_IDThis will be auto-generated if left blank. If populated, be sure to include a unique value relative to other records.
TOPIC_MATCHThis can be anything. NOTIFY records will target this via the TOPIC field, and messages will be routed to all gateways with a matching TOPIC_MATCH value.

Here is an example NOTIFY_ROUTE entry:

==================================
NOTIFY_ROUTE
==================================
Field Name Value Type
===========================================================================================
TIMESTAMP 2022-10-26 15:38:52.152(n:0,s:3711) NANO_TIMESTAMP
GATEWAY_ID GenesisScreen1 STRING
NOTIFY_ROUTE_ID 000000000000202NRLO1 STRING
TOPIC_MATCH TOPIC1 STRING
-------------------------------------------------------------------------------------------
TIMESTAMP 2022-10-26 15:38:52.162(n:0,s:3712) NANO_TIMESTAMP
GATEWAY_ID GenesisScreen1 STRING
NOTIFY_ROUTE_ID 000000000000203NRLO1 STRING
TOPIC_MATCH TOPIC2 STRING

SCREEN_NOTIFY_ROUTE_EXT

Field NameUsage
ENTITY_IDString identifying the entity to send to.
ENTITY_ID_TYPEOne of USER_NAME, PROFILE_NAME, ALL, or SELF. An additional value will be available that matches the ENTITY_ADMIN_PERMISSION_FIELD, if it is defined in Sysdef.
NOTIFY_ROUTE_IDReference to a primary KEY in the NOTIFY_ROUTE table.

NOTIFY

Writing a record to this table, which correctly points to a TOPIC with matching routes will result in a pop-up toast being sent to the list of users detailed on the route.

Equally, EVENT_NOTIFY_INSERT can be used, as opposed to a direct table write (this is the encouraged form of interaction). This event allows for the same set of fields as the DbRecord. The input fields detailed below cater for either approach.

Field NameUsage
APPLICATION_REFN/A
BODYThe body of the message, this can be in json format to help display on screen.
HEADERN/A
NOTIFY_IDAutogenerated Unique value
NOTIFY_SEVERITYN/A
SENDERN/A
TOPICThe TOPIC_MATCH value on the NOTIFY_ROUTE record you wish to target

Here is an example of using NOTIFY:

==================================
NOTIFY
==================================
Field Name Value Type
===========================================================================================
TIMESTAMP 2022-11-02 19:26:27.061(n:0,s:1015) NANO_TIMESTAMP
BODY {"MESSAGE":"A trade quantity has been... STRING
DOCUMENT_ID STRING
HEADER quantity over 10 STRING
NOTIFY_COMPRESSION_TYPE STRING
NOTIFY_ID 000000000001301NTLO1 STRING
NOTIFY_SEVERITY Information ENUM[Information Warning Serious Critical]
SENDER STRING
TOPIC TOPIC1 STRING
-------------------------------------------------------------------------------------------

This example results in a toast pop-up message, such as: