Suggestions for testing rules

Guidewire recommends that you practice the following simple suggestions to make testing and debugging your rules a straightforward process:

  • Enter one rule at a time and monitor for syntax correctness—check the green light (at the bottom of the pane) before starting a new rule.
  • Enter rules in the order in which you want the debugger to evaluate them: Condition and then Action.
  • Maintain two sessions while testing. As you complete and save each rule in Studio, toggle to an open PolicyCenter session and test before continuing. You only need save and activate your rules before testing. You do not need to log in again.

For multi-conditioned rules, you can print messages to the console after each action for easy monitoring. The command for this is print("message text"). The message prints in the server console. This is helpful if you want to test complex rules and verify that Studio evaluated each case.

Other print-type statements that you can use for testing and debugging include the following:

gw.api.util.Logger.logDebug
gw.api.util.Logger.logError
gw.api.util.Logger.logInfo
gw.api.util.Logger.logTrace

These all log messages as specified by the PolicyCenter logging settings.