Email Notifications: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
Line 14: Line 14:
* '''Name''': Describing name for the notification identifying the notification in the list of model's notifications.
* '''Name''': Describing name for the notification identifying the notification in the list of model's notifications.
* '''To''', '''Cc''', '''Bcc''': To, cc and bcc recipients for the email message. At least one valid email address needs to be defined in any of these fields.
* '''To''', '''Cc''', '''Bcc''': To, cc and bcc recipients for the email message. At least one valid email address needs to be defined in any of these fields.
* Subject: Subject of the email message.
* '''Subject''': Subject of the email message.
* '''Body: Body of the email message. The body can be defined as an html document, if ''Body is html'' is checked.
* '''Body: Body of the email message. The body can be defined as an html document, if ''Body is html'' is checked.
* '''Model filter''': Model data is filtered using this filter, before the data is used for the notification calculation.
* '''Model filter''': Model data is filtered using this filter, before the data is used for the notification calculation.

Revision as of 23:24, 8 February 2021

Introduction

Notifications send emails messages automatically when there is something notable in the processes. When creating notifications, criteria for sending is defined. Notifications set defined for models, and each model can have several notifications.

Notification is processed as follows:

  1. The entire model data is taken as a basis and the optional filter is applied to the model data.
  2. Data is dimensioned using the optional dimensions. Notifications will be sent for each of the dimension values.
  3. Measures are calculated for each of the dimension value. Measures are needed, if the email subject or body needs to contain dynamically changing information based on the actual data.
  4. Criteria is applied for each of the potential notification. If the criteria evaluates to false, the notification is not sent. Dimensions and measures can be used in the criteria expression.

Creating notifications

Notifications are edited in Email notifications dialog that can be opened in the models list by first selecting Notifications. Defining notifications requires at least project Designer or Administrator permissions (GenericWrite permission).

Notifications have following settings:

  • Name: Describing name for the notification identifying the notification in the list of model's notifications.
  • To, Cc, Bcc: To, cc and bcc recipients for the email message. At least one valid email address needs to be defined in any of these fields.
  • Subject: Subject of the email message.
  • Body: Body of the email message. The body can be defined as an html document, if Body is html is checked.
  • Model filter: Model data is filtered using this filter, before the data is used for the notification calculation.
  • Measures: Measures are calculated for each of the dimension value (or the entire data, if no dimensions are defined). Measures can be used in the email fields and also in the Criteria expression.
  • Criteria: Optional expression that determines whether the email is sent or not. For example, this can be used to define a criteria that the notification is sent only if a measure is greater than the defined threshold value.
  • Body is html: When checked, the email body is an html document. If unchecked, the email body is plaintext.
  • Priority: Priority of the email message: High, Normal or Low.
  • From email address: Email address where the notification appears to be coming from. If there is a default from address defined for the system, this field can be left empty.
  • Sender:
  • Reply to address: One or several email addresses which appear as recipients when replying to the notification email.
  • Dimensions: Dimensions can be used the notification definition needs to send several emails to different recipients (for example, related to each region, product or customer). If no dimension is defined, only one notification email is sent.

In the fields defining the email message (e.g. To, Cc, Bcc, Subject, Body) it's possible to define measure and dimensions names using syntax ${name}. It's also possible to define any expressions inside the curly brackets. Examples:

Email subject:

Process is blocked for total of ${numberOfCases} orders
Process is blocked for total of ${Count(EventLog.Cases)} orders

Sending notifications

Notifications can be sent either in the Email notifications dialog by clicking the Send notifications button, or by using the Model.TriggerNotifications() function in the expression language. Notifications can be triggered from the SQL scripts as follows (notifications Notification 1 and Notification 2 for model id 123):

(SELECT 'AnalysisType', '33') UNION ALL
(SELECT 'ContextType', 'Generic') UNION ALL
(SELECT 'Configuration', '{"Root":"ModelById(123).TriggerNotifications([""Notification 1"", ""Notification 2""])"}')
--#GetAnalysis