Debug a rule
Rule designers can debug rules by using logMsg() statements to obtain information regarding the rule logic and make sure it works as desired.
Note:
Before you can debug a rule, test data must have been entered for the rule. The Debug button runs the rule against data entered for the subject for which the rule was accessed, this includes relevant data entered in other visits.
The log window appears on the right in the Rule editor.
Rule runs against data of the selected subject and outputs the calls
made to the logMsg()
helper function within the rule and for all
instances. This means that, if the rule belongs to a form in multiple visits or a
question in repeating sections, the rule is analyzed for all impacted visits and
repeating sections. The output from each rule instance is listed in the log
window.
If any exception is encountered, the stack trace details and error messages are displayed in the log window.
Tip:
Since thelogMsg()
helper function only runs in debug mode, there
is no need to remove the calls before publishing the rule.
After saving, you must test rule performance to be as expected. To make your rule available in Production, you must test, approve, and publish your rule.
For examples, and more information on developing custom rules, see:
Parent topic: Create rules using the rule editor