Policy plugin

You can customize how PolicyCenter determines whether the application can start various jobs, based on dynamic calculations on the policy. Define your own implementation of the IPolicyPlugin plugin to customize all jobs except submission. There is a built-in implementation of this plugin with default behaviors.

Can start cancellation

Implement the canStartCancellation method to customize whether cancellation can start, given a policy and the effective date of the cancellation. The method must return null if the policy can be canceled. If the policy cannot be canceled then the method returns a String containing an error message to display.

The built-in implementation of this plugin requires the following conditions to exist.

  • There is a promoted PolicyPeriod that includes the effective date passed to the method.
  • The user has permission to cancel the policy.
  • The policy is not already canceled as of the effective date. This allows for canceling an already canceled policy on an earlier date.
  • There is no open issuance job for the policy. This ensures that issuance and cancellation jobs are never both open at the same time.
  • The policy does not have an open rewrite job.
  • Current and future terms have not been archived.

Implement your own version of this plugin to customize this behavior.

Can start reinstatement

Implement the canStartReinstatement method to customize whether reinstatement can start, given a PolicyPeriod entity for the canceled period. It must return null if the policy can be reinstated, or if it cannot be reinstated then return a String describing an error message to display.

The built-in implementation of this plugin requires the following conditions to exist.

  • This PolicyPeriod is the most recent bound branch for this contractual period.
  • The policy is issued.
  • The policy is canceled.
  • The policy does not have a completed final audit.
  • The policy does not have an open rewrite job, issuance job, or reinstatement job.
  • The user has permissions to reinstate this period.
  • The reinstatement period does not overlap any existing bound period.
  • Current and future terms have not been archived.

Can start rewrite

Implement the canStartRewrite method to customize whether rewrite can start, given a Policy entity and the effective and expiration dates for the rewrite job. The method returns null if the policy can be rewritten. If the policy cannot be rewritten then the method returns a String describing an error message to display.

The built-in implementation of this plugin requires the following conditions to exist.

  • The user has the permission to rewrite.
  • There is a bound PolicyPeriod entity in the contractual period for the provided effective date.
  • The policy period must be canceled.
  • The rewrite effective date is equal to or after the cancellation date.
  • There are no other jobs open on the policy except audits.
  • The policy is issued.
  • The new contractual period would not overlap with any bound existing one.
  • The current term is not archived.

Can start policy change

Implement the canStartPolicyChange method to customize whether a policy change can start, given a Policy entity and the effective date for the policy change job. It must return null if the policy can change at that effective date, or if it cannot change then return a String describing an error message to display.

The built-in implementation of this plugin requires the following conditions to exist.

  • The user has permission to change the policy.
  • There is a bound PolicyPeriod entity in the contractual period for the provided effective date.
  • The based on PolicyPeriod is in effect at the effectiveDate.
  • The policy does not have an in-progress rewrite job or issuance job.
  • Current and future terms have not been archived.
  • The policy is issued.

By default, PolicyCenter does not prevent concurrent policy changes. PolicyCenter only warns the user. If you want to completely prevent concurrent policy changes in the same contractual period (rather than just warn the user), implement this behavior in the canStartPolicyChange method.

Can start audit

Implement the canStartAudit method to customize whether an audit job can start, given a Policy entity and the effective date for the audit job. The method returns null if the policy can change at that effective date. If the policy cannot change, then the method returns a String describing an error message to display.

The built-in implementation of this plugin requires the following conditions to exist.

  • The policy is a monoline workers’ compensation policy.
  • The user has permission to create and complete an audit job.
  • The policy is issued.
  • The current term is not archived.

Can start issuance

Implement the canStartIssuance method to customize whether an issuance job can start, given a Policy entity. It must return null if the policy can issue at that effective date, or if it cannot issue then return a String describing an error message to display.

The built-in implementation of this plugin requires the following conditions to exist.

  • The policy contains a bound PolicyPeriod entity, and finds the most recently bound contractual period if there is more than one.
  • That policy is not issued.
  • The user has permission to issue the policy.
  • That policy is not canceled.
  • The user has the permission to issue a policy.
  • There are no other open jobs.
  • The current term is not archived.

Can start renewal

Implement the canStartRenewal method to customize whether a renewal job can start, given a Policy entity. the method returns null if the policy can renew at that effective date. If the policy cannot renew, then the method returns a String describing an error message to display.

The built-in implementation of this plugin requires the following conditions to exist.

  • The user has permission to create and complete a renewal job.
  • The policy is issued.
  • The policy is not already canceled.
  • There is no open rewrite or renewal job.
  • There is a bound branch for this policy.
  • The current term is not archived.

Utility functions in the base configuration plugin

The base configuration of the plugin has utility methods that are not in the plugin definition. Use or copy these methods as necessary.

  • appendIfFalse – Given a Boolean condition, appends an error message String to an existing StringBuilder object. This is useful to make concise and readable code that tests a condition.
  • errorString – Given a StringBuilder instance, converts to a String and omits any final comma.