Creating a Scheduled Notification for an Event
Creating a Scheduled Notification for an Event
The following is a simplified walk-through for creating a scheduled notification for an event/task/action item:
- Create a record in the messages table that contains the string for the email subject. Optionally add localized versions of the string to the record. Optionally use activity_log field references in the strings.
- Create another record in the messages table that contains the string for the email body text. Optionally add localized versions of the string to the record. Optionally use activity_log field references in the strings.
- (Optional) Create a record in the notify_cat table to assign a category to the notifications.
- Create a record in the notify_templates table that contains the notification trigger conditions (based on status and date fields in activity_log), the email recipients, foreign key references to the email subject and body strings you created in steps 1 and 2, and the notification category you created in step 3.
- If the event/task/action item is not an activity_log table record, create an activity_log record and copy the status, date, and other corresponding fields from your event/task/action record to activity_log fields. You will need to create custom code to keep the activity_log.status field updated with the status of your event/task/action item.
- Create a record in the notifications table that contains a foreign key to the notify_templates record you created in step 4, and a foreign key to the activity_log record (existing or created in step 5).
The ScheduledNotificationService WFR automatically manages the rest.
When testing, make sure that you have correctly configured your Web Central mail server settings (mail.properties) for a working mail server. See Archibus Configuration Options .
The above steps are all that is necessary if your scheduled notifications integration project does not need the user to interact directly with the notifications toolkit. For example, your application automatically and transparently creates the notifications, using values already used in your application.
However, if your application requirements are such that the user needs the ability to create their own notification categories, templates, messages, template assignments, etc., then you’ll need to design a user interface that is appropriate for your application. You can use the Compliance Management interfaces as a reference or starting point:
- Business Process Owner - Compliance / Define Notification Categories
- Business Process Owner - Compliance / Define Notification Templates
- Business Process Owner - Compliance / Define Notification Messages
- Compliance Program Manager / Manage Compliance Event Notifications
In the Compliance view for defining notification templates, notice the field “Send If Event Status Is” field in the form. This is a virtual field that contains only specific status-based trigger conditions that are of interest in Compliance. The view abstracts the SQL for the trigger condition fields so that user doesn’t need to deal with SQL. There is a fixed SQL expression corresponding to each selection in the dropdown for the “Send If Event Status Is” virtual field. The view places the correct SQL expression in the
notify_templates.trigger_condition_to field
that corresponds to the selection in the dropdown.
You should use a similar approach in your custom view for defining notification templates. If you need to give the user maximum control over the status trigger condition, you may consider having both a dropdown with user-friendly strings for the most commonly used status trigger conditions, and a box where the user can edit the SQL expression directly for the
trigger_condition_to
and
trigger_condition_from
fields.
Although Compliance has a custom view for defining compliance specific notification messages, there is a general system administration view for defining messages, so you don’t have to create a custom view unless you want to give users access to a simpler, customized view within your application. The sysadmin view is found at: System / Archibus Administrator - Application Configuration / Edit Messages . http://localhost:8080/archibus/schema/ab-core/views/process-navigator/navigator-details.axvw.
Usage Notes
- The Scheduled Notifications toolkit does not provide any reusable UI components, as each activity has different UI requirements and use cases. Use the Compliance UI as a guideline.
- The Toolkit does not support time-based notifications.
- The Toolkit does not support date processing based on a time-zone that is different from the Web Central server. Therefore, all date arithmetic happens using the Web Central server’s local time and module does not take the time-zones of the recipients into consideration.
- Managing records in notify_templates and notifications table is the responsibility of each application. Notify_templates and notifycat tables have an activity_id field to organize records by activity. Each activity must populate this field and should only touch its own records.
- The database schema is set up for an alerts functionality (upon Web Central login), but that functionality is not yet implemented.