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
Parameter | Name | Type |
---|---|---|
NotificationRecipient | Notification Recipient | NotificationRecipient |
channelProtocolLinkList | List of Dispatch Channels | Array of ChannelProtocolLinkList |
createdBy | Notification Author | string |
id | Notification Record ID | integer($int64) |
message | Message Text | string |
notificationAttributes | Message Attributes | string |
recipientGroupId | Recipient Group ID | integer($int64) |
templateId | Notification Template ID | integer($int64) |
type | Notification Type | integer($int64) |
Sending Notification to a List of Email Addresses, Event Contract: qun-notification-command
Parameter | Name | Type |
---|---|---|
NotificationRecipient | Notification Recipient | Array of NotificationRecipient |
channelProtocolLinkList | List of Dispatch Channels | Array of ChannelProtocolLinkList |
createdBy | Notification Author | string |
id | Notification Record ID | integer($int64) |
message | Message Text | string |
notificationAttributes | Message Attributes | string |
recipientGroupId | Recipient Group ID | integer($int64) |
templateId | Notification Template ID | integer($int64) |
type | Notification Type | integer($int64) |
Object Schemas
NotificationRecipient
Notification Recipient
Parameter | Name | Type |
---|---|---|
Recipient's Email (for "Employee" recipient) | string | |
id | Recipient Record ID | integer($int64) |
name | Recipient Name | string |
recipientId | Recipient ID (role ID, employee ID, department ID) | integer($int64) |
systemName | Recipient's System Name (role/system login of employee/department system name) | string |
type | Recipient Type: • 1 - Employee; • 2 - Department; • 3 - User Role; • 4 - Recipient Group. | integer($int64) |
ChannelProtocolLinkList
List of Dispatch Channels
Parameter | Name | Type |
---|---|---|
channelSysName | Dispatch Channel System Name | string |
message | Message Text Template for the Channel | string |
messageHTML | HTML Format Message Text Template for the Channel | string |
messageType | Message Type | integer |
subject | Email Subject | string |
Event Formation Options for Sending Notifications
A notification can be formed in two ways:
- 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
.
- 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
Variable | Type | Example | ||||||
---|---|---|---|---|---|---|---|---|
channelProtocolLinkList | Groovy Script | [["channelSysName": "email", "message": "Test1"]] | ||||||
message | String or Expression | "Notification about created task" | ||||||
type | String or Expression | 1 | ||||||
notificationRecipient | Map |
|
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.
Variable | Type | Example | ||||||
---|---|---|---|---|---|---|---|---|
notificationAttributes | Groovy Script | def text = "{\"taskId\": \"" + response.content.stream().findFirst().get().id.toString() + "\", \"startDate\": \"" + startDate + "\", \"endDate\": \"" + endDate + "\", \"statusName\": \"" + statusName + "\", \"fullName\": \"" + responseEmployee.fullName + "\", \"url\": \"" + url + "\"}"; text | ||||||
channelProtocolLinkList | Groovy Script | [["channelSysName": "email"]] | ||||||
message | Groovy Script | "Subordinate created a vacation request. It needs to be confirmed through user task №${taskId}" | ||||||
type | String or Expression | 1 | ||||||
notificationRecipient | Map |
|
Sending Notification with Template Parameters
Variable | Type | Example |
---|---|---|
notificationAttributes | Groovy Script | def text = "{\"taskId\": \"" + response.content.stream().findFirst().get().id.toString() + "\", \"startDate\": \"" + startDate + "\", \"endDate\": \"" + endDate + "\", \"statusName\": \"" + statusName + "\", \"fullName\": \"" + responseEmployee.fullName + "\", \"url\": \"" + url + "\"}"; text |
templateId | String or Expression | 1 |
Sending Notification to Email
Variable | Type | Example | ||||||
---|---|---|---|---|---|---|---|---|
channelProtocolLinkList | Groovy Script | [["channelSysName": "email"]] | ||||||
message | String or Expression | "Notification about created task" | ||||||
type | String or Expression | 1 | ||||||
notificationRecipient | Map |
|