The Data Structure for a Notification

2 minute read time.

A simple Notification can be of two types

  • OnScreen Notification
  • Email Notification

Both types of Notification can be seen in the WorkflowRules table.

E.g.

select * from workflowrules where wkrl_ruletype = 'time' and wkrl_deleted is null



OnScreen Notifications

In the above example a simple Notification has been created to display an onScreen Notice. This has the wkrl_ruleid of 10134.

I can track the data that defines the notification using these SQL statements.

select * from workflowrules where wkrl_ruletype = 'time' and wkrl_ruleid = 10134
select * from notifications where notf_ruleid = 10134
select * from workflowactions where wkac_value like 'Escalations10134%';
select * from workflowactionlinks where acli_actiongroupid = (select wkrl_actiongroupid from workflowrules where wkrl_ruletype = 'time' and wkrl_ruleid = 10134)
select * from custom_captions where capt_code like 'Escalations10134%'

WorkflowRules

This table holds the definition of the rule and the SQL that determines when the rule should fire.

Notifications

This table holds the conditions that are used to determine the SQL held in the WorkflowRules table. The table is used to build the User Interface that simplifies the creation of the Notification. There may be up to 5 rows for each WorkflowRule defined using the simple Notification feature.

WorkflowActions

The WorkflowActions holds the definition that this is either an onScreen notification or an email. The wkac_action field for a simple notification will be either 'Notify' or 'Email'. There is a wider range of actions available for escalation rules created using the Administration>Advanced Customization>Escalation screens.

WorkflowActionLinks

This table binds the workflow action to the workflow rule.

Custom_Captions

This table will hold the Notification message that is displayed.

Email Notifications


We can create an Email Notification in a similar way to the above example. Here we can assume that the new workflow rule has the wkrl_ruleid of 10134.

We can track the data that defines the email notification using these SQL statements.

select * from workflowrules where wkrl_ruletype = 'time' and wkrl_ruleid = 10135
select * from notifications where notf_ruleid = 10135
select * from workflowactions where wkac_value like 'Escalations10135%';
select * from workflowactionlinks where acli_actiongroupid = (select wkrl_actiongroupid from workflowrules where wkrl_ruletype = 'time' and wkrl_ruleid = 10135)
select * from custom_captions where capt_code like 'Escalations10135%'
select * from emailtemplates where emte_id =(select wkac_emailtemplateid from workflowactions where wkac_value like 'Escalations10135%')

The roles of the tables are broadly the same when defining an Email Notification as when they were defining an onscreen Notification. The exception is the the workflowactions table and the emailtemplates table.

The workflowactions has a link to the emailtemplates table.

EmailTemplates

This table holds the body of the email, whether defined in HTML or plain text and will hold the email addresses of the recipients.

e.g.

EmTe_To: #comp_primaryuserid#
EmTe_CC: Susan Maye ; Damien Walsh
EmTe_BCC: Brian Little