Triggers are used to automatically create and assign corrective actions. Think of a trigger as a rule or set of business logic a newly collected inspection is evaluated against to determine if a new corrective action is necessary. A trigger consists of 3 core components - an inspection type, an inspection attribute, and a threshold - and can include auto assign and a completion window if HBAC is enabled.
- Inspection type - a trigger is applied to a specific inspection type, either a routine, reinspection, or complaint inspection.
- Inspection attribute - this specifies what a trigger should look at to determine if a corrective action should be created. Triggers can currently evaluate the number of critical violations, total number of violations, and Hazel Score.
- Thresholds are set for each attribute by the user, and determine when a corrective action is created. For example, you could set a threshold of greater than 3 critical violations or less than 50 on a Hazel Score.
Here is an example of a common trigger:
This trigger will create corrective actions when there is a routine inspections with either:
- More than 2 critical violations
- Or more than 5 total violations
New inspections that are collected by Hazel are evaluated against these criteria in this order. So if a new inspection is collected and it has more than 2 critical violations, new corrective actions will be created for those critical violations.
If that same inspection also has more than 5 total violations, corrective actions will be created for the remaining non-critical violations.
When triggers evaluate the number of critical violations in an inspection, only those critical violations will receive corrective actions. When triggers evaluate the total number of violations of the Hazel Score, then all violations in that inspection will receive corrective actions.