Notification flattening

Incoming notifications follow a format described in Worker Notification Script. This has nested objects and repeating groups.

Before rules are applied to the notification, a flattened version of the notification is created. This is an array with one object per recipient and one object without a recipient. This makes it easier to apply rules. The flattened version is also passed to the notification channel, to simplify applying the notification to a template. The flattened version contains the fields required by the Notification email template, which is used when the notification manager is not installed. For historic reasons, there is an inconsistency in style between these and other fields (lowerCamelCase vs lower_snake_case).

The flattening is performed by Mapper Script, and the mappings are defined within Notification Router Script. Each notification is turned to an array of objects with the following properties.

notification Name (title) of the notification. Not usually used for matching.
description Description of the notification. Not usually used for matching.
timestamp Event timestamp, or notification timestamp, in display format. Not used for matching.
worker Name of the worker/task. Not usually used for matching.
process_type_reference The process type reference, which defaults to the process type name.
process_type_name The process type name, which defaults to the process type reference.
event_type_reference The event type reference, which defaults to the event type name.
event_type_name The event type name, which defaults to the event type reference.
group_name The folder name (folders are known as "groups" internally).
group_path The folder path (folders are known as "groups" internally).
system Combination of application and main (see below), or just one of them if they are the same. This is suitable as the name of the system that the user thinks they are using.
application The main application or service, e.g. "Metrici".
main The name of the application that produced the notification, e.g. "Portal".
rootPath Root path.
workerURL URL to open worker.
recipient The name of the recipient. Not set for the flattened row that does not have a recipient.
recipient_user_id The user logon reference of the recipient. Not set for the flattened row that does not have a recipient.
recipient_email_address The email address of the recipient. Not set for the flattened row that does not have a recipient.