Sending Web Application Notifications
Notifications are sent when some CRUD operation is performed. By using the Notifications feature, you can send notifications to users using the same application.
Example:
Suppose 3 users are working on the same task, creating a resource. When a resource is created by user 1, users 2 and 3 should be notified.
Steps:
Create a JavaScript that calls the
CreateNotificationAPI.Sample JavaScript:
context.log("creating notification for input: "+ input);varresult;if(input.actionName =="insert") {varcreateNotification = context.getApi("CreateNotification");createNotification.input = input;createNotification.execute();}Apply this JavaScript as a Post Persistence API to the Resource Entity.
Navigate to:
Resource Entity > Properties Panel > Persistence > Post Persistence API Name
Save the entity.
When the web application is running and a new resource is added, notifications are sent to the other users.