Email Notifications: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
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. When ''triggered'', a notification is processed as follows:
Notifications send automatic email messages based on defined rules, for example when there are deviations in the process requiring actions. Notifications are defined for models, and each model can contain several notifications. Notifications are sent based on the following logic:
# The entire model data is taken as a basis and the optional '''filter''' is applied to the model data.
# The optional '''filter''' is applied to the model data, or if there is not filter defined, the entire model data is used.
# Data is '''dimensioned''' using the optional dimensions. Notifications will be sent for each of the dimension values.
# If notifications are meant to be sent to different recipients with different content for each recipient, the data can be optionally divided into '''dimensions''' (notifications will be sent for each of the dimension values).
# '''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.
# If the email subject or body needs to contain dynamically changing information based on the actual data, '''measures''' can be defined which are calculated for each of the dimension values.
# '''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.
# As last, a '''criteria''' defining for example a threshold value, is applied for each of the dimension value (i.e. a potential notification), and based on it actual notification email is either sent or not. Dimensions and measures can be used in the criteria expression (as variables by their names).


== Creating notifications ==
== Creating notifications ==

Revision as of 16:27, 9 February 2021

Notifications send automatic email messages based on defined rules, for example when there are deviations in the process requiring actions. Notifications are defined for models, and each model can contain several notifications. Notifications are sent based on the following logic:

  1. The optional filter is applied to the model data, or if there is not filter defined, the entire model data is used.
  2. If notifications are meant to be sent to different recipients with different content for each recipient, the data can be optionally divided into dimensions (notifications will be sent for each of the dimension values).
  3. If the email subject or body needs to contain dynamically changing information based on the actual data, measures can be defined which are calculated for each of the dimension values.
  4. As last, a criteria defining for example a threshold value, is applied for each of the dimension value (i.e. a potential notification), and based on it actual notification email is either sent or not. Dimensions and measures can be used in the criteria expression (as variables by their names).

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