Notifications
Ways of notification creation

Methods for Generating Notifications

The notification generation process for both event-driven interaction and REST API calls is the same. Below is the description for an event.

Sending Notification, Event Contract: qun-notification-create

ParameterNameType
NotificationRecipientNotification RecipientNotificationRecipient
channelProtocolLinkListList of Dispatch ChannelsArray of ChannelProtocolLinkList
createdByNotification Authorstring
idNotification Record IDinteger($int64)
messageMessage Textstring
notificationAttributesMessage Attributesstring
recipientGroupIdRecipient Group IDinteger($int64)
templateIdNotification Template IDinteger($int64)
typeNotification Typeinteger($int64)

Sending Notification to a List of Email Addresses, Event Contract: qun-notification-command

ParameterNameType
NotificationRecipientNotification RecipientArray of NotificationRecipient
channelProtocolLinkListList of Dispatch ChannelsArray of ChannelProtocolLinkList
createdByNotification Authorstring
idNotification Record IDinteger($int64)
messageMessage Textstring
notificationAttributesMessage Attributesstring
recipientGroupIdRecipient Group IDinteger($int64)
templateIdNotification Template IDinteger($int64)
typeNotification Typeinteger($int64)

Object Schemas

NotificationRecipient

Notification Recipient

ParameterNameType
emailRecipient's Email (for "Employee" recipient)string
idRecipient Record IDinteger($int64)
nameRecipient Namestring
recipientIdRecipient ID (role ID, employee ID, department ID)integer($int64)
systemNameRecipient's System Name (role/system login of employee/department system name)string
typeRecipient Type:

• 1 - Employee;
• 2 - Department;
• 3 - User Role;
• 4 - Recipient Group.
integer($int64)

ChannelProtocolLinkList

List of Dispatch Channels

ParameterNameType
channelSysNameDispatch Channel System Namestring
messageMessage Text Template for the Channelstring
messageHTMLHTML Format Message Text Template for the Channelstring
messageTypeMessage Typeinteger
subjectEmail Subjectstring

Event Formation Options for Sending Notifications

A notification can be formed in two ways:

  1. Independently create a notification without using a template. In this case, the following parameters need to be specified:
  • channelProtocolLinkList - list of channels for sending;
  • notificationRecipient / recipientGroupId - notification recipient or the identifier of the distribution group (which includes the list of recipients);
  • type - notification type;
  • message - notification text template (static text);
  • notificationAttributes - message attributes if a parameterized text template was specified in message.
  1. Form a notification using a template. In this case, the following parameters need to be specified:
  • templateId - notification template identifier;
  • notificationAttributes - message attributes if a parameterized text template was specified in the template.

Examples of forming notifications in the process designer editor will be presented below.

Sending Static Text

VariableTypeExample
channelProtocolLinkListGroovy Script[["channelSysName": "email", "message": "Test1"]]
messageString or Expression"Notification about created task"
typeString or Expression1
notificationRecipientMap
KeyValue
recipientId${execution.getVariable('employeeId')}
type1

empty

Sending Template Text Notification and Parameterized

When filling in the value of the notificationAttributes variable, line breaks can be made. Line break is made after the "+" sign.

VariableTypeExample
notificationAttributesGroovy Scriptdef text = "{\"taskId\": \"" + response.content.stream().findFirst().get().id.toString() + "\", \"startDate\": \"" + startDate + "\", \"endDate\": \"" + endDate + "\", \"statusName\": \"" + statusName + "\", \"fullName\": \"" + responseEmployee.fullName + "\", \"url\": \"" + url + "\"}"; text
channelProtocolLinkListGroovy Script[["channelSysName": "email"]]
messageGroovy Script"Subordinate created a vacation request. It needs to be confirmed through user task №${taskId}"
typeString or Expression1
notificationRecipientMap
KeyValue
recipientId${execution.getVariable('employeeId')}
type1

empty

Sending Notification with Template Parameters

VariableTypeExample
notificationAttributesGroovy Scriptdef text = "{\"taskId\": \"" + response.content.stream().findFirst().get().id.toString() + "\", \"startDate\": \"" + startDate + "\", \"endDate\": \"" + endDate + "\", \"statusName\": \"" + statusName + "\", \"fullName\": \"" + responseEmployee.fullName + "\", \"url\": \"" + url + "\"}"; text
templateIdString or Expression1

empty

Sending Notification to Email

VariableTypeExample
channelProtocolLinkListGroovy Script[["channelSysName": "email"]]
messageString or Expression"Notification about created task"
typeString or Expression1
notificationRecipientMap
KeyValue
recipientId${execution.getVariable('employeeId')}
type1

empty