Write an Error Event Rule

An error event is used to pass a message to the user, and prevent them from continuing an investigation until the condition which triggered that error no longer applies. Error event rules operate in a similar way to normal rules, except that instead of inferring an attribute, they execute a command (that is, firing the command specified in the conclusion line of the event rule).

To write an error event rule in Policy Modeling, use the following syntax for the conclusion line of the rule:

  • Error("<error message text>") if

For example:

Error("You can only be married to one person.") if

the applicant's number of spouses > 1

You can substitute attribute values in error message text to make it more meaningful. For example:

Error("Please enter at least one of %person_name%'s symptoms") if

the person has not entered at least one symptom and

the interview is for another person

You should never use 'it is currently unknown if [condition]' in an error event rule as this will trigger the error at the beginning of any interview, and will also prevent checkpoints from being resumed. Using 'it is uncertain whether or not [condition]' is also strongly discouraged for the likelihood that it will cause checkpoints to be un-resumable.

Tip: To change the appearance of the error message on screen, see Change the Appearance of Headings and Labels. The applicable setting is the Error label. Note that changing this setting will also change the appearance of errors that are triggered by input validations. The Business License Wizard, DMV Document Guide, Hazard Management, Health Diagnosis, myBenefits, Parental Leave Calculator, Safety Inspection, Retail Discounts and Warranty example policy models that are installed with Policy Modeling contain error event rules.