Audit schedule selector plugin

You can customize how PolicyCenter chooses the audit schedule pattern for cancellation and expiration by implementing the IAuditSchedulePatternSelectorPlugin plugin interface. You define (and edit) the audit schedule patterns in Product Designer as part of the product model.

The built-in implementation is provided in AuditSchedulePatternSelectorPlugin.gs, which you can modify or use as the basis for your own version.

PolicyCenter includes several schedules in the built-in implementation. The built-in plugin implementation references several of these.

There are two methods that you must implement.

  • selectFinalAuditSchedulePatternForCancellation – Returns the cancellation audit schedule pattern to use for final audits. It takes a PolicyPeriod and returns an AuditSchedulePattern object.
  • selectFinalAuditSchedulePatternForExpiredPolicy – Returns the expiration audit schedule pattern to use for final audits. It takes a PolicyPeriod and returns an AuditSchedulePattern object.

In the built-in implementation, these methods ignore the PolicyPeriod. Instead, the methods simply iterate across all schedule patterns to find a pattern that matches a specific pattern code.

class AuditSchedulePatternSelectorPlugin implements IAuditSchedulePatternSelectorPlugin {

 override function selectFinalAuditSchedulePatternForCancellation(period : PolicyPeriod) :
        AuditSchedulePattern {
    return AuditSchedulePatternLookup.getAll().firstWhere(\ f -> f.Code == "CancellationPhone")
  }

 override function selectFinalAuditSchedulePatternForExpiredPolicy(period : PolicyPeriod) :
        AuditSchedulePattern {
    return AuditSchedulePatternLookup.getAll().firstWhere(\ f -> f.Code == "ExpirationPhysical")
  }
}