Querying notifications via RSC INotificationLoggerService

Notifications that have been saved by means of the Notification Logger can be queried via RSC interfaces, and one that is already provided with the PLCnext Runtime is this INotificationLoggerService.

You can use filter criteria for the query in order to specify the query. You can query all archives or the notifications of one specific archive.

How to

Use the Arp/Services/NotificationLogger/Services/INotificationLoggerService.hpp interface. Further information on the classes and their applications is available directly in the code commentary.

The QueryStoredNotifications method

Use the QueryStoredNotifications method to query saved notifications. You can limit the query using the following parameters:

Parameter Data type Description
archives String[] List of names of archives to be queried. If this list is empty, all archives with sufficient access rights are queried.
filter NotificationFilter Specification of the filter for the query (see here)
limit int32 Maximum number of notifications to be returned
sortOrder SortOrder Sorting criterion of the query
language String Desired language of user data (de, en_GB, etc.). Note: this feature is currently not supported

 

The NotificationFilter struct object

If using RSC, the filters are described by a structure with reference values or Regular expressions. The limits are part of the specified area. The individual criteria are ANDed. The NotificationFilter struct object includes these fields:

 

Field Data type Description
StoredIdLowerLimit uint64 Lower limit of the StoredId (> = 1), is ignored if = 0
In the Notification Logger, a notification is clearly identified by a StoredId (uint64). The StoredId is assigned by the Notification Logger when adding the notification to the input buffer.
StoredIdUpperLimit uint64 Upper limit of the StoredId (> = 1, < = 18446744073709551615, max. uint64), is ignored if = 0
NotificationNameRegExp String Regular expression for the notification name. Is ignored if field is empty.
SenderNameRegExp String Regular expression for the sender name. Is ignored if field is empty.
TimestampBefore String

Oldest applicable notification. Is ignored if field is empty. The format complies with ISO 8601 plus indication of microseconds: YYYY-MM-DDThh:mm:ss.SSSSSS

TimestampAfter String Latest applicable notification. Is ignored if field is empty. The format complies with ISO 8601 plus additional indication of microseconds: YYYY-MM-DDThh:mm:ss.SSSSSS
SeverityLowerLimit String Lowest applicable severity. Is ignored if field is empty.
SeverityUpperLimit String Highest applicable severity. Is ignored if field is empty.

 

The StoredNotification struct object

The values are returned via the StoredNotification struct object. The object includes the following fields:

Field Data type Description
Id uint64 ID of saved notification (StoreId)
Archive String Name of the archive the notification was loaded from.
If the notification is present in several archives, this field contains a list of archives separated by commas.
NotificationName String Name of the notification
SenderName String Name of the sender
TimeStamp String Timestamp of when the notification was sent. The format complies with ISO 8601 plus additional indication of microseconds: YYYY-MM-DDThh:mm:ss.SSSSSS
Severity String Severity of the notification
Payload String[] Translated and formatted representation of user data
PayloadXml String[] User data as XML

 

User roles with access permissions

The following table shows which user role is authorized to what extent to call the methods of the INotificationLoggerService. User roles not contained in this table do not have access permission. 

 

User role QueryStoredNotifications
QueryNotifications
DeleteNotifications ListArchives Other
Admin
Engineer  
Commissioner    
Service    
DataViewer    
DataChanger    
Viewer