Document Selection

Overview

The Document Selection Plugin decides whether a given document will be attached, subject to eligibility defined in the product configuration. The plugin will be called once per quote or policy transaction state change, where that state change is defined as a trigger for one or more documents for the product.

For each potential document, the plugin will select one of:

  • generate: Always creates a new document, which will replace that document (if any) in the document scope.

  • noAction: Leaves the existing document in place, if any, according to scope rules. Never generates a new document.

  • generateIfAbsent: Behaves like noAction if the document already exists in the scope, or like generate if the document does not yet exist.

  • remove: Removes the document if it already exists. Does not generate a new document.

Here, “the document” means any instance of the specific document declared in configuration, for the scope for that doc. In other words, the basis for the equivalence check is the staticName of the document.

The document instance could change with versioned resource selection. For example, if we have a document declared with static name newJerseyDisclosures with term scope, and which has V1, V2, and V3 variations, the above choices would be based on comparing documents in the term by newJerseyDisclosures, NOT newJerseyDisclosuresV1.

For each generate or applicable generateIfAbsent choice, the system will create a draft document, including locators, and attach the document to the transaction.

This plugin is executed synchronously with the transaction state change.

For each remove choice, the transaction will record that the document is to be removed from the policy with that transaction, along with other documents removed based on scope. For documents configured with scope transaction, remove has no practical effect since the document is local to the transaction itself.