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
attachmentsList of attachments filesArray of Attachments
createdByNotification Authorstring
idNotification Record IDinteger($int64)
messageMessage Textstring
messageHTMLMessage text in HTMLstring
messageTypeMessage typestring
notificationAttributesMessage Attributesstring
notificationAttributesJsonMessage Attributes in JSON. This field is used if the attributes are not specified in the notificationAttributesobject
objectIdProcess object ID in which the notification was sentstring
objectNumberProcess object number in which the notification was sentstring
objectTypeProcess object type in which the notification was sentstring
recipientGroupIdID of recipient groupinteger($int64)
recipientGroupSystemNameSystem name of recipient groupstring
soundAlarmIndication of an audible signal when sending a notificationbool
templateIdNotification Template IDinteger($int64)
templateSystemNameSystem name of notification templatestring
typeNotification Typeinteger($int64)
typeSystemNameSystem name of notification typestring
useCurrentUserMailIndicates whether the current user's email address is being used to send notificationsbool

Sending Notification, 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
externalSystemIdRecipient's system name. It can be used to send an email addressstring
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 (employee);
• 2 - Department (department);
• 3 - User role (role);
• 4 - Recipient group (group);
• 5 - Telegram chat (TELEGRAM_CHAT);
• 6 - Email (EMAIL);
• 7 - Phone number (PHONE_NUMBER);
• 8 - Application instance token (APPLICATION_INSTANCE_TOKEN);
• 9 - Participant (PARTICIPANT).
integer($int64)

ChannelProtocolLinkList

List of Dispatch Channels

ParameterNameType
attachmentsList of attachments filesArray of Attachments
channelSysNameDispatch Channel System Namestring
messageMessage Text Template for the Channelstring
messageHTMLHTML Format Message Text Template for the Channelstring
messageTypeMessage Typeinteger
subjectEmail Subjectstring

Attachments

List of attachments files

ParameterNameType
contentTypeFile Content typestring
fileThe name of the file with the path in the file storagestring
fileIDFile ID in the file storagestring
fileInfoIdFile Info ID in the file storageinteger($int64)
fileNameFile name with the extensionstring
isBase64Indication of base64 encodingbool
storageFile storage location in the file storagestring

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.
  • notificationAttributesJson - message attributes in JSON format, if a parameterized text template was specified in the message. Used if attributes are not specified in the notificationAttributes field.
  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.
  • notificationAttributesJson - message attributes in JSON format, if the template specified a parameterized text template. Used if attributes are not specified in the notificationAttributes field.

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 a template notification text with parameterization

When filling in the value of the notificationAttributes variable, line breaks can be made. Line break is made after the "+" sign. One of the variables notificationAttributes OR notificationAttributesJson' is filled in. When filling in both fields, the values are used from the notificationAttributes` field.

VariableTypeExample
notificationAttributesGroovy Scriptdef text = "{\"taskId\": \"" + response.content.stream().findFirst().get().id.toString() + "\", \"startDate\": \"" + startDate + "\", \"endDate\": \"" + endDate + "\", \"statusName\": \"" + statusName + "\", \"fullName\": \"" + responseEmployee.fullName + "\", \"url\": \"" + url + "\"}"; text
notificationAttributesJsonString or Expression{"taskId" : ${taskId}}
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

An example of setting up sending a parameterized notification with business process attributes.

empty

An example of configuring the sending of a parameterized notification with attributes in JSON format is a business process.

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

An example of setting up sending notifications with template parameters through a business process.

empty

An example of setting up sending notifications with parameters in JSON format using a template through a business process.

empty