PostIssuance Plugin Beta
Warning
This documentation is preliminary and is subject to change frequently until the General Availability release of this feature. Please contact your account representative with any questions or if you have feedback.
Overview
Some complex policies have many small documents, which are rendered separately. For cases where it’s desired to present these to the insured as a single package, it is useful to consolidate them within a single PDF file.
To support this and future use cases, Socotra now has a PostIssuance plugin which will fire after each major policy transaction’s issue event. The consolidation order can be invoked within this event.
Process
When the plugin is triggered, the following will occur:
The
datapayload is sent to the plugin and afterwards the returned object is inspected.The response to the initiating API request is made, and then an asynchronous consolidation procedure is initiated.
If there are any PostIssuancePluginConsolidation objects, then for each one, in the order that the document locators are listed, they will be concatenated into a single consolidated document.
Metadata will be set for the new document, including
fileNameanddisplayName.The consolidated document will then be persisted, and it will then appear with other policy documents with the policy.
Note
If the deleteSourceDocuments property is true, each source document will be removed after consolidation
Important
The deletedSourceDocuments property is not yet enabled. It will be in an upcoming release.
Important
Document consolation is an asynchronous process. Consolidation may not be complete at the time of the initial API response.
Configuration
This plugin is configured similarly to other plugins. See the Plugins topic for details. Here is a portion of a policy’s policy.json file enabling the plugin:
{
"plugins": {
"getOnIssuePostProcessorResult": {
"path": "main/postIssuance.js",
"enabled": true
}
}
Script
The plugin is invoked with a data payload that contains information about the documents for the policy. Here is a simple example that shows all of the documents being consolidated on each invocation:
function getPostIssueResult(data)
{
let locators = data.documents.map(d => d.locator);
return {
documentConsolidations: [{
displayName: "My Consolidated Document",
documentLocators: locators,
fileName: "consolidated.pdf",
deleteSourceDocuments: true
}]
};
}
exports.getOnIssuePostProcessorResult = getPostIssueResult;
requiredpolicyLocator stringdocuments [PostIssuancePluginDocument]operation string newBusiness | endorsement | renewal | reinstatement | cancellationpolicy PluginPolicyInfo
requiredlocator stringpolicyholderLocator stringproductName string
requiredlocator stringdisplayName stringfileName stringoptionalcreatedTimestamp timestampurlExpirationTimestamp timestamppolicyModificationLocator stringurl string
requireddocumentConsolidations [PostIssuancePluginConsolidation]
requireddisplayName stringdocumentLocators [string]fileName stringoptionaldeleteSourceDocuments boolean
Document Types
Only PDFs are supported. HTML-based documents can neither be a source of a consolidated document, nor the resultant document.