Purge worker
The Purge worker picks up a job from the Purge
work queue and purges or prunes jobs that meet the criteria. The following
flow chart shows how the purge worker processes the job. Any job that
emerges from step 7 will be considered for purging by the batch process
on or after the NextPurgeCheckDate.
The numbered items in the flow chart are described below.
- In this step, the job is evaluated according to the following
criteria:
Condition
Configurable in Purge plugin?
Configurable in config.xml?
Is the
PurgeStatusnot equal toNoActionRequired?On the policy period that is the
SelectedVersion, is theStatusnot bound, making the job a candidate for purging?Does the job have more than one policy period, making the job a candidate for pruning?
Then the worker updates the
PurgeStatus. - This decision point evaluates whether the job and all of
its policy periods can be purged. A job can be purged if all of the following
apply:
Condition
Configurable in Purge plugin?
Configurable in config.xml?
The policy is not bound.
The job subtype is a subtype for purging.
Calls the
AllowedJobSubtypesForPurginggetter in thePurgePluginplugin interface.• The
DoNotDestroyflag is set tofalseon the policy and all policy periods on the job.The purge date returned by the getPurgeJobDate method is less than or equal to the current date.
The purge date is calculated by comparing the job close and policy end dates with configuration parameters. For more information, see Quote purging configuration parameters.
Calls the getPurgeJobDate method in the
PurgePluginplugin interface.• • The job has no open activities.
The job has no archived policy periods.
There are no workflows on any policy period in the job.
For information about a process that purges workflows, see About purging activity-related workflow data.
- In this step, the purger purges the job in two separate
bundles:
- The first bundle calls the
createContextand prepareForPurge methods in thePurgePluginplugin interface.For each policy period in the job, the purger calls the skipPolicyPeriodForPurge method in the
PurgePluginplugin interface. This bundle then purges the job and the related objects. - The second bundle calls the
postPurge method in the
PurgePluginplugin interface.Important: Guidewire recommends that you put business critical operations in the prepareForPurge method so that the first bundle does the purge and business critical operations. Do not put business critical operations in the second bundle. If by chance the system fails while the purger is processing the job, the second bundle may not occur. If the first bundle does not complete, the bundle transaction consisting of theprepareForPurgeand the purge-from-database action is rolled back. The job will be again be a candidate for purging or pruning the next time the batch process picks it up.
- The first bundle calls the
- This decision point evaluates whether the policy periods on
a job can be pruned. The policy periods on a job can be pruned if all of the
following apply:
Condition
Configurable in Purge plugin?
Configurable in config.xml?
The job subtype is a subtype for pruning.
Calls the
AllowedJobSubtypesForPruninggetter in thePurgePluginplugin interface.• The prune date returned by the getPruneJobDate method is less than or equal to the current date.
The prune date is calculated by comparing the job close and policy end dates with configuration parameters. For more information, see Quote purging configuration parameters.
Calls the getPruneJobDate method in the
PurgePluginplugin interface.• • The job has no open activities.
The job has no archived policy periods.
If the previous conditions are met, then each individual policy period is evaluated for pruning. The policy period is sent to the purger if the following apply:
Condition
Configurable in Purge plugin?
Configurable in config.xml?
The policy period is not bound.
The
DoNotDestroyflag is set tofalseon the policy period.There are no workflows on the policy period.
- In this step, the purger prunes policy periods on the job
in two separate bundles:
- The first bundle calls the
prepareForPurge method in the
PurgePluginplugin interface.For each policy period in the job except the selected version, the purger calls the
skipPolicyPeriodForPurgein thePurgePluginplugin interface. This bundle then purges the policy periods and the related objects. - The second bundle calls the
postPurge method in the
PurgePluginplugin interface.Important: Guidewire recommends that you put business critical operations in the prepareForPurge method so that the first bundle does the purge and business critical operations. Do not put business critical operations in the second bundle. If by chance the system fails while the purger is processing the job, the second bundle may not occur. If the first bundle does not complete, the bundle transaction consisting of theprepareForPurgeand the purge-from-database action is rolled back. The job will be again be a candidate for purging or pruning the next time the batch process picks it up.
- The first bundle calls the
prepareForPurge method in the
- This step updates the
PurgeStatusto one of the following values:NoActionRequired– This is the most common case. For example,PurgeStatusgets this value when the only remaining period is bound.Pruned– When there is one and only one policy period version remaining.Unknown– If the purge status is unknown. For example if a version that is not the selected version is markedDoNotDestroy, then pruning leaves that version as well as the selected version.
- This step calculates the next purge check date. This step
calls the calculateNextPurgeCheckDate method in the
PurgePluginplugin interface.When the batch process runs again, this job will be reevaluated for purging or pruning.
