Notifications

New functionality in Effector platform version 6.2.001 is handling and displaying notifications. Notifications are processed per minutes. You can see the actual notifications by click on notification icon (this screen can be overridden).

The base databasedatabase has been expanded with the following:

  • table which contains the notifications
  • table which contains the persons related to notifications (here can be recorded the date when the notification is received)
  • table which contains the notification types
  • table which contains the log data related to notifications
  • stored procedure to insert new notification
  • stored procedure to invalidate notifications related to a given object

States

Possible states of the notification object are the following:

1 = new, 2 = read, 3 = unread, 4 = deleted, 5 = expired

Tables

FSYS_NotificationType:

Usable notification types are stored in this table. There is no defined notification type by default, however you have to insert at least one row to the table for notifications.

Fields

  • ID (int, unique ID),
  • Name (varchar, name of type),
  • Deleted (tinyint, is deleted?),
  • Created (datetime, creation date),
  • CreatedByID (int, creator ID)

FSYS_Notification:

Notifications are stored in this table.

Fields

  • ID (int, unique ID),
  • NotificationType_ID (int, reference to field ID of tableFSYS_NotificationType),
  • Title (varchar, short title),
  • QuickInfo (varchar, short information, displayed on the card),
  • Message (varchar, text of the notification, displayed on the card),
  • URL (varchar, link of the notification, if there is a link to the object or page),
  • Created (datetime, creation date),
  • CreatedByID (int, creator ID),
  • Deleted (tinyint, is deleted?)

FSYS_UserNotification:

Users assigned for the notifications and unique status per users are stored in this table.

Fields

  • ID (int, unique ID),
  • Guid (uniqueidentifier, ID used during execute stored procedure),
  • Notification_ID (int, reference to field ID of table FSYS_Notification),
  • UserID (int, user ID related to the notification),
  • Status (int, state of the notification (1-5)),
  • Created (datetime, creation date),
  • CreatedByID (int, creator ID),
  • ValidFrom (datetime, start date of the validity (non mandatory)),
  • ValidTo (datetime, end date of the validity (non mandatory)),
  • Deleted (tinyint, is deleted?)

FSYS_UserNotification_Log:

Status changes by users are stored in this table.

Fields

  • ID (int, unique ID),
  • UserNotification_ID (int, reference to field ID of table FSYS_UserNotification),
  • Field (varchar, name of the field),
  • OldValue (varchar, old value),
  • NewValue (varchar, new value),
  • Deleted (tinyint, is deleted?)

Stored procedures

osp_FSYS_AddNotification:

It inserts the notification and returns with a notification ID.

It has the following parameters:

  • NotificationType
  • Message
  • Title
  • QuickInfo
  • Url (optional)
  • UserID (optional)
  • Status (optional)

It gives an error message when the notificationType from the parameter doesn't exist or the state is not in the [1,5] interval.

osp_FSYS_AddUserToNotification:

It assigns a user to a notification and also inserts to the log table.

It has the following parameters:

  • NotificationID
  • UserID
  • Status

It gives an error message when the NotificationID doesn't exist or the state is not in the [1,5] interval.

osp_FSYS_SetUserNotificationStatus:

It can be used to change status of user notification and also inserts to the log table.

It has the following parameters:

  • UserID
  • Guid
  • Status

It gives an error message when the given user hasn't got a notification with the given GUID or the state is not in the [1,5] interval.

osp_FSYS_SetUserNotificationValidity:

It can be used to set the start and end date of the user notification and also inserts to the log table.

It has the following parameters:

  • UserID
  • Guid
  • ValidFrom
  • ValidTo

It gives an error message when the given user hasn't got a notification with the given GUID.

osp_FSYS_GetNotifications:

It returns the user's notifications. If parameter NewerThan is set, it only return the notifications which are newer than that value. It returns only with new and unread notifications. If parameter Guid is set, it limits the query to that value.

It has the following parameters:

  • UserID
  • Guid (optional)
  • NewerThan (optional)

Parameterization

Displaying notifications can be enabled in XML file Profile. Setting IsNotificationEnabled can be used to enable the function (boolean, false by default). Setting NotificationScreen optionally can be used to select which popup screen will be loaded when click on notification icon.

Basic functionality

Used stored procedures for the implementation:

  • osp_sel_FSYS_GetNotifications: this stored procedure links the tables to DataDefintion defined on notification screen with data
  • osp_prs_FSYS_SwitchUserNotificationStatus: this stored procedure changes the state of the notification (new, read -> unread, unread -> read)

  • Last update: 25 weeks 4 days ago
  • Effector