Creating alerts

You can use the Alert Definitions - Details page to create an alert. This page lets you write an alert message, define the conditions under which the alert is sent, and determine who receives the alert.

Alert types

There are two types of alerts:

  • Query-based: Built using SQL
  • Rowsource-based: Built using Java

Query alerts are the most common type. The Not Clocked-In Alert is an example of a query-based alert that is provided with the application.

Rowsource alerts are used to create alerts with custom actions and parameters. For example, an alert to show all unauthorized records with a WRK time code. When creating rowsource alerts, a new class implementing row sources is created, and the Source Class field value is set to the full path of this class.

You can use the generic builder class com.workbrain.app.wbalert.source.TimeCodeAlertSource to implement the alert mechanism. This class has three parameters that are specified when the alert is scheduled:

  • Time code
  • Minimum minutes
  • Work date

Alert recipients

You can configure the system to send the alert to a specific user, members of a team, and users with a specified security role. When you select multiple criteria, such as the Supervisor security role and several team names, the alert is sent to the users who match any of the criteria. In this situation, all the users with the Supervisor security role and all the members of the selected teams are sent the alert.

An alert’s recipient also controls (by user name, team, or security role) the data that is included in the alert.

When alerts are sent to users or team names, the alerts include data on all employees. For example, if you configure the system to send the Late - Left Early Alert to the Administrative team, whenever any employee (not just members of the Administrative team) arrives late or leaves early, the alert is sent to members of the Administrative team.

When alerts are sent to security roles, the alerts only include data on the employees the users that are assigned that role have security permissions to view. For example, if the system sends the Not Clocked-In Alert to the Supervisor security role, users with the Supervisor role are only sent the alert when employees in their team do not clock in.