...
The Handler Configuration paves the way for configuring Alerts, Custom Handler and Audit.
- Click Handler Configuration drop-down list and three different segments namely, Alerts, Custom Handler and Audit appear.
Alerts
Alerts can be of much significance to the users. Ranging from login activities to request approvals, events can help you to keep track of the alerts in a smooth and convenient way. To configure Alerts, perform the following steps.
- Click icon to configure Alerts.
The New Alert page appears.
The Alert ID gets assigned automatically.
- If you wish to change the Alert ID, type the numbers of your choice.
- Click the Severity drop-down list to choose the level of severity.
- If you want to assign a new datasource, then enter a relevant value in the Datasource text field, e.g. com.intellectdesign.modelhouse.alert.handler.NotificationAlertDataSource.
Note: The aforementioned datasource class needs to implement IAlertDataSource.
- Assigning the relevant datasource class facilitates the purpose of fetching the target recipients. It is not mandatory to enter a value in the field of Datasource. If the field is left blank, then the default datasource class will be taken into account.
- The Description gets assigned automatically. If you wish to modify the Description, then you can modify it. Select the Entitlement drop-down list and click SELF option. Based on the selected Entitlement, the alerts tend to differ for each and every type. Select the checkbox of Alert Enabled.
- If you wish to assign an engine class for the Entitlement Type, click icon to configure Entitlements. A new pop-up appears. Type SELF in the text field of Entitlement Type and enter a relevant value in the text field of Engine Class, e.g. com.intellectdesign.modelhouse.alerts.EventEntitlementEngine. After entering the values, click Save to save the changes.
Channel Configuration determines the type of channel and the users can receive the alerts, through the means of the channel, which they prefer to choose. Inbox, SMTP, SMS and Push Notifications are the four available channels. Inbox indicates the messages that appear as notifications in the application. SMTP indicates electronic mails. SMS appears as a text message in mobile, whereas Push notifications serve the purpose, in the form of a mobile notification.
- In the section of Channel Configuration, click Channels drop-down list to select the channel of your choice, e.g. INBOX.
Inbox
- On selecting Inbox, you can find new set of options like Insert Key, Template Formatter, Language, Short Message/Subject, Select Header/Footer Template and Detailed Message.
- Click the drop-down list of Template Formatter and you can choose any one of the options from FreeMarker or Canvas – Default.
- Type the words of your choice in the field of Short Message/Subject. Click icon to choose header or footer template in the field of Select Header/Footer Template. If you don't wish to choose a template for Header and Footer, then you can proceed further. The Insert Key drop-down list comprises of various keys. While entering the text in Detailed Message, make sure that you use Insert Key drop-down list in accordance with the assigning of alerts. For instance, if request approval is involved, then APPROVER_NAME can be used for more significance.
- You can even allot multiple Insert Keys, while typing the words of your choice in Detailed Message text field. The following screen shot showcases the usage of a second Insert Key, known as APPROVER_ID.
- After typing the words of your choice in the text field of Detailed Message, click Add.
The newly created alert appears on the right side, in the form of channel number; which denotes the channel type, e.g. 2001 denotes Inbox.
SMTP
- To create alerts for SMTP, click Channels drop-down list and select the option of 2002-SMTP.
- Select either Canvas – Default or FreeMarker from Template Formatter drop-down list. Enter the words of your choice in the text fields of Short Message/Subject and Detailed Message. While entering the text in Detailed Message, make sure that you use Insert Key drop-down list in accordance with the assigning of alerts. Once you have completed the proceedings, click Add.
SMS
- To create alerts for SMS, click Channels drop-down list and select the option of 2003-SMS.
- Select either Canvas – Default or FreeMarker from Template Formatter drop-down list. Enter the words of your choice in the text fields of Short Message/Subject and Detailed Message. While entering the text in Detailed Message, make sure that you use Insert Key drop-down list in accordance with the assigning of alerts. After completing the proceedings, click Add.
Push Notifications
- To create alerts for Push Notifications, click Channels drop-down list and select the option of 2004-PUSHNOTIF.
- Select either Canvas – Default or FreeMarker from Template Formatter drop-down list. Enter the words of your choice in the text fields of Short Message/Subject and Detailed Message. While entering the text in Detailed Message, make sure that you use Insert Key drop-down list in accordance with the assigning of alerts. After completing the proceedings, click Add.
The created alerts appear on the right side and the numbers denote the channel types (2001 – INBOX, 2002 – SMTP, 2003 – SMS, 2004 – PUSH NOTIFICATION).
- Click Save to save the created alerts.
The newly created Alert can be viewed in Alerts section under the segment of Handler Configuration. To edit the Alert, click icon, whereas to delete it, click icon.
Custom Handler
To configure Custom Handler, perform the following steps.
- Click icon to configure Custom Handler.
Custom Handler Mapping page appears.
- Click the Handler drop-down list and select 10003-Cache Cleanup Handler.
- For other handlers, click icon, adjacent to the Handler drop-down list.
A new pop-up appears.
The relevant values of the handlers can be found in the EVENT_HANDLER_MASTER_TABLE in Canvas Schema.
- Enter the relevant values in the fields of Handler ID, Handler Class, Handler Description and Priority. For Container ID, click icon to select the form; that has been mapped to a container or enter the apt title of the Container ID. Based on the configuration of values, click the Y checkboxes of Ignore Exception and Is Synchronized? After completing the proceedings, click Create.
- If old values are required for the handler, click the Old Values Required checkbox.
- Click Save to save the changes.
The created Handler can be viewed in Custom Handler section under the segment of Handler Configuration. To edit the Custom Handler, click icon, whereas to delete it, click icon.
Audit
To configure Audit, perform the following steps.
- Click icon to configure Audit.
The Audit page appears.
- The Audit ID is assigned automatically and you can modify it. Only numbers are permitted in the field of Audit ID. Enter the value, com.intellectdesign.canvas.audit.handler.AuditDataFormatter in Audit Formatter text field. Proceed to click icon of Form ID to select a form.
- List of forms appear and you can select the form of your choice. For instance, NEW_PAYEE_FORM.
- Click Form Fields drop-down list.
- Click the form fields, which you wish to select. To perform a search, type the name of the form field in the Type to search field.
- After completing the proceedings, click Save to save the changes.
The newly created Audit can be viewed in Audit section under the segment of Handler Configuration. To edit Audit, click icon, whereas to delete it, click icon.
- In the Event page, click Submit.
A confirmation message, indicating a successful save appears.
- Click Ok.
Editing and Deleting Events
To edit and delete events, perform the following steps in Canvas Studio.
- On the home page of Canvas Studio, click Events on the left navigation pane.
The List of Events page appears.
- To edit an event, perform a right-click on the event and select Edit Event option.
The Event page appears. You can edit the fields which you want to edit, but Event ID remains as a non-editable field.
- To delete an event, perform a right-click on the event and select Delete Event option.
- Click Delete on the bottom right side of the Event Creation page.
A confirmation message appears, indicating a successful deletion.
Raising Events
After an event is configured in Canvas Studio, a simple Java handler is necessary to trigger the event. Let's assume that the event is a login activity, so when the user logs in, the event has to be raised to send an alert and an audit. Once the login event is configured in Canvas Studio, the Java Handler triggers the event, thereby facilitating the means for receiving alerts. The following code snippet is a sample Java Handler to raise an event:
Event eventToBeRaised = Event.getEventFor(<EVENT_ID>); HashMap eventData = new HashMap(); EventDispatcher.getInstance().raiseEvent(eventToBeRaised , eventData);
For further information on Handler Configuration, refer the following pages: