Policy number generator plugin

The IPolicyNumGenPlugin interface is responsible for generating a policy number for the current policy period. This number differs from the policy number associated with the root Policy object which is shared by all periods of the policy. The policy number for the current policy period is associated with a particular instance of a PolicyPeriod object and can vary from one period to another.

The plugin interface has a single method called genNewPeriodPolicyNumber.

genNewPeriodPolicyNumber(policyPeriod : PolicyPeriod) : String

The policyPeriod argument references the PolicyPeriod entity to generate a policy number for.

The method returns the generated policy number as a String.

The method is called as part of a Submission job when creating the first period of a policy and also when rewriting or renewing a policy. If the user attempts to rewrite a policy, the PolicyCenter user interface provides a choice between reusing the current policy number or generating a new one. Depending on the user's selection, the value of the Rewrite.isChangePolicyNumber is set appropriately. If set to true, PolicyCenter calls the plugin to generate a new number.

The base configuration implements the plugin in the PolicyNumGenPlugin class. This implementation is for demonstration purposes and must be configured prior to being placed in a production environment. Its single public method always generates a new and random policy number if the policyPeriod argument's Status field is set to the typecode value of PolicyPeriodStatus.TC_LEGACYCONVERSION. Otherwise, the Job field of the policyPeriod determines whether to generate a new policy number. If the Job is of type Submission, Rewrite, or RewriteNewAccount, a new and random policy number is generated. For all other types of Job, such as Renewal, the policyPeriod object's PolicyNumber field value is returned.

Policy numbers conform to field validator

PolicyCenter includes a feature called field validators that help you ensure accurate input within the web application user interface. In the case of policy numbers, field validators ensure that user input of a policy number exactly matches the correct format. The following example shows a policy number field validator.

<ValidatorDef name="PolicyNumber" value="[0-9]{3}-[0-9]{5}"
  description="Validator.PolicyNumber"
  input-mask="###-#####" />

If you are implementing policy number generator code for the first time, you must configure the policy number field validator so that it matches the format of your policy number. After you first implement a policy number generator or later change the policy number format, coordinate changes to the field validators or user entry of policy numbers fails.