Set up push notifications for mobile application users
Creatio mobile app uses push notifications to display custom notifications on mobile devices. These "push notifications" are generated by a pre-configured "Send push notifications" BPMN process. Use it as a sub-process to integrate push notifications in your custom processes and cases.
Create a business process that will send a push notification to mobile app users once they are added to activities as participants. The notification message displays the name of the activity and text "You have been added as participant." By tapping the notification, the user opens the corresponding activity record.
Business process diagram (Fig. 1) elements:
-
Signal start event: "Activity participant added" – the process is triggered when a contact is added to activity participants.
-
Read data system action: "Read activity participant data" – the process obtains activity participant data needed to perform the next steps.
-
Read data system action: "Read system administration object data" – based on the activity participant data, the process obtains information on the user whose contact was added to activity participants.
-
Read data system action: "Read activity data" – based on the activity participant data, the process obtains information on the activity record. Outgoing conditional flow to the terminate element that will end the process if the activity participant is the same as the activity author (to avoid sending push notification to the activity author). Outgoing default flow to the "Send push notification" sub-process.
-
Sub-process: "Send push notification" – the process sends push notification to the specified user with the specified text.
To configure the process:
-
Place the Signal element of the Initial events group on the schema — "Activity participant added". The element will be activated when a contact is added on the Participants detail of the activity.
-
Set up the signal parameters:
-
In the Which type of signal is received? field, select "Object signal."
-
In the Object field, select "Activity participant."
-
In the Which event should trigger the signal field, select "Record added."
The "Activity participant added" element properties (Fig. 2):
-
-
Set up the "Read activity participant data" element properties (Fig. 3):
-
In the Which data read mode to use? field, select "Read the first record in the selection."
-
In the Which object to read data from? field, select "Activity participant."
-
Set up the following filter in the How to filter records? area: "Id = Activity participant added.Unique identifier of record."
noteTo set the "Id = Activity participant added.Record Id" filter: click Add condition, select the Id column; click <?> and select Compare with parameter command; select the "Activity participant added" signal in the list to the left, and select the "Id" column in the list to the right.
-
In the What record data should the process read? field, select "Read data from selected columns only."
-
Add the "Activity" and "Participant" columns (only these two columns from the activity participant record will be used further in the process).
noteWe recommend to restrict the list of columns, whose values are read by the Read data elements, to those used in the process. This will increase the overall Creatio performance and lower the hardware load in applications with many processes in progress.
-
-
Set up the "Read system administration object data" element properties (Fig. 4):
-
In the Which data read mode to use? field, select "Read the first record in the selection."
-
In the Which object to read data from? field, select "System administration object."
-
Set up the following filter in the How to filter records? area: "Contact = Read activity participant data.First item of resulting collection.Participant."
noteTo set the "Id = Read activity participant data.First item of resulting collection.Participant" filter: click Add condition, select the Contact column; click <?> and select Compare with parameter command; select the "Read activity participant data" element in the list to the left, and select the "Participant" column in the list to the right.
-
In the What record data should the process read? field, select "Read data from selected columns only."
-
Add the "Id" column (the "Send push notification" process will require the identifier of the user to send push notification to).
-
-
Set up the"Read activity data" element properties (Fig. 5):
-
In the Which data read mode to use? field, select "Read the first record in the selection."
-
In the Which object to rad data from? field, select "Activity."
-
Set up the following filter in the How to filter records? area: "Id = Read activity participant data.First item of resulting collection.Activity."
noteTo set the "Id = Read activity participant data.First item of resulting collection.Activity" filter: click Add condition, select the Contact column; click <?> and select Compare with parameter command; select the "Read activity participant data" element in the list to the left, and select the "Activity" column in the list to the right.
-
In the What record data should the process read? field, select "Read data from selected columns only."
-
Add the "Subject" and "Reporter" columns (the "Send push notification" process will use the "Subject" column as the title of the push notification and the "Reporter" column will be used in the conditional flow).
-
-
Set up the properties of the outgoing conditional flow (Fig. 6).
- In the Condition to move down the flow parameter, click and select Process elements. In the Formula window, click the "Read activity participant data" in the list to the left and select Participant column in the list to the right.
- Type "==" after the selected formula in the formula area.
-
Click the "Read activity data" in the list to the left and select Reporter column in the list to the right.
As a result, the formula area will contain the following formula: "#Read activity participant data.First item of resulting collection.Participant# == #Read activity data.First item of resulting collection.Reporter#" (Fig. 7).
-
Set up the "Send push notification" sub-process to send notification to the user that was selected by the "Read system administration object data" element.
-
In the Related entity parameter, click and select Lookup value. In the lookup window, select the "Activity" object.
-
In the Related record ID parameter, click and select Process parameter. In the Select parameter window, click the "Read activity participant data" in the list to the left and select Activity column to the right.
noteThe Related entity (EntityUID) and Related record ID (RecordId) parameters of the "Send push notification" sub-process determine which record page will open when the user taps the push notification on their mobile device. For example, to open the activity page, we selected the "Activity" object as the value of the Related entity parameter, and mapped the Related record ID to the unique identifier of the activity record to open.
The Related entity (EntityUID) and Related record ID (RecordId) parameters are optional. If they are left empty, tapping a push notification will simply open Creatio mobile app.
As a result, when the business process is run, a push notification will be sent to the user, whose contact was added as the activity participant (Fig. 8).
-
See also
Notify employees by email when a lead has been received via a landing page