Gosu code and archiving

After archiving, PolicyCenter deletes most of the PolicyPeriod subtypes, but keeps the PolicyPeriod, its associated EffectiveDatedFields, and optionally some other entities. The deleted subtypes are no longer accessible through Gosu code. For more information about the entities that remain in PolicyCenter, see Entities retained after archiving.

If archiving is enabled and your code accesses policy periods, your code needs to check whether that policy period is archived before attempting to traverse the subtypes. If your code attempts to traverse the subtypes in an archived PolicyPeriod, PolicyCenter throws an exception.

If there is a need to change an archived policy period, you must retrieve the archived policy period from the archive store.

In the default configuration, PCF files and code checks for archiving before traversing a policy period. For example, you may see code checking for archiving in policy terms and policy periods such as:

  • aPolicyPeriod.PolicyTerm.Archived
  • aPolicyPeriod.BasedOn.PolicyTerm.Archived – If you are about to do a policy comparison, for example
  • aJob.SelectedVersion.PolicyTerm.Archived

A PolicyPeriod has been archived if the Archived bit is set to true.

The basedOn property of a given PolicyPeriod might be in a prior term, so that based-on policy period must also be checked.

Displaying Jobs or Policies

In the default configuration, the JobForward and PolicyFileForward PCF files are used by other PCF files and Gosu code to display a single job or policy. These PCF files figure out, among other things, whether or not the user arrives at the wizard for a job or policy or the archived policy period screen instead.

A PCF file that displays or potentially modifies archivable entities calls the JobForward or PolicyFileForward PCF file. These PCF files contain code to handle the display of an archived policy term or policy period. Care still needs to be taken with actions (such as calculating differences or starting jobs) whose success is dependent on other terms.

Jobs and Archiving

While writing Gosu code, be aware that PolicyCenter has the following restriction related to jobs and archiving:

  • You cannot start a job on an archived policy term.
  • You cannot start a job if there is a future archived policy term. You cannot start a job because an out-of-sequence change may necessitate updates to future policy terms.
  • You cannot archive a policy term if there is are open jobs in a previous term.

Search and Archiving

While writing Gosu code, be aware that search does not find properties on effective-dated entities removed from the database through archiving. The search simply fails to return those archived rows. Search screens may need to be aware of archiving and adjust the display when Include Archived or the like is selected.

Excluding a Policy from Archiving

The Policy entity has a DoNotArchive property. Users can manage the DoNotArchive property from the application. You can also manage this property through the ArchiveAPI web service. To set the DoNotArchive property requires the archivedisable and archiveenable privileges.

See also