Creating a PDF Policy in Financial Services Accelerator

A Policy in PDF format can be viewed and saved when the customer purchased the policy.

Creating a PDF Policy

The Policy in PDF format is created when the customer reaches the Final Review page. The customer can download, print, or view the PDF file depending on the browser settings. Each file contains a Context object which contains all of the information needed to render the PDF - both property types share a common Context object. Context objects are populated by PolicyData DTO objects - this class also contains a PolicyHolderDetailData DTO describing the owner of the policy. The PolicyData is often populated by the InsuranceQuote taken from the OrderData object.

The policy contains:

  • Front Page
    • Static Image
    • The Insurance Category retrieved from the policy.order.planproduct.defaultCategory
  • Page 1
    • Table Of Contents
      • Key Facts
      • Medical Exclusions
      • Declaration of Medical Conditions
      • Policyholder Summary Information
      • Benefits
      • Frequently Asked Questions
      • Definitions
      • Claims
      • Closing
  • Page 2 - Key Facts
  • Page 3 - Medical Exclusions
  • Page 3 - Declaration of Medical Conditions
  • Page 4 - Policyholder Summary Information

    Event

    • Title, First Name, Surname - sourced from PolicyHolderDetailData which is populated by extracting values from the YFormDataData.xml
    • Policy Id - sourced from the Order/OrderData.code,
    • Policy Type - Order.entry.product.defaultCategory,
    • Policy Cost - order.totalPrice is used for the oneTimeCost and the recurringCost is only ever populated by the mock policy generator.

    Travel

    • Title, First Name, Surname - sourced from PolicyHolderDetailData which is populated by extracting values from the YFormDataData.xml
    • Policy Start Date - the InsuranceQuote.tripStartDate - populated from the model map with a key of tripStartDate,
    • Policy End Date - the InsuranceQuote.tripEndDate which is populated from the Model map with a key of tripEndDate,
    • Policy Type - Order.entry.product.defaultCategory,
    • Policy Cost - order.totalPrice is used for the oneTimeCost and the recurringCost is only ever populated by the mock policy generator.

    Property

    • Title, First Name, Surname - sourced from PolicyHolderDetailData which is populated by extracting values from the YFormDataData.xml,
    • Policy Type - Order.entry.product.defaultCategory,
    • Address 1 - sourced from the InsuranceQuoteData - which is populated from the Map of values on the QuoteModel - key: property-address-line-1,
    • Cover Required - sourced from the InsuranceQuoteData - which is populated from the Map of values on the QuoteModel - key: propertyDetailsCoverRequired,
    • Property Type - sourced from the InsuranceQuoteData - which is populated from the Map of values on the QuoteModel - key: propertyType,
    • Property Value - sourced from the InsuranceQuoteData - which is populated from the Map of values on the QuoteModel - key: propertyValue,
    • Policy Cost - order.totalPrice is used for the oneTimeCost and the recurringCost is only ever populated by the mock policy generator,
    • Policy Start Date - the InsuranceQuote.propertyStartDate, also populated from the Model map using a key of propertyDetailsStartDate.

    Life

    • Applicant One - Row header for applicant one
      • Coverage - sourced from LifeDetailsData - which is populated from the Map of values on the QuoteModel - key: lifeCoverageRequire,
      • Length of Coverage - sourced from LifeDetailsData - which is populated from the Map of values on the QuoteModel - key: lifeCoverageLast,
      • Date of Birth - sourced from LifeDetailsData - which is populated from the Map of values on the QuoteModel - key: lifeMainDob,
      • Smoker - sourced from LifeDetailsData - which is populated from the Map of values on the QuoteModel - key: lifeMainSmoke,
      • Coverage Start Date - sourced from LifeDetailsData - which is populated from the Map of values on the QuoteModel - key: lifeCoverageStartDate,
    • Applicant Two - Row header for applicant two
      • Date of Birth - sourced from LifeDetailsData - which is populated from the Map of values on the QuoteModel - key: lifeSecondDob,
      • Smoker - sourced from LifeDetailsData - which is populated from the Map of values on the QuoteModel - key: lifeSecondSmoke.

Auto

    • Column1
      • First Name, Surname - sourced from PolicyHolderDetailData which is populated by extracting values from the YFormDataData.xml
      • Vehicle License - sourced from AutoDetailsData - which is populated from the Map of values on the QuoteModel - key: vehicleLicense,
      • Vehicle make - sourced from AutoDetailsData - which is populated from the Map of values on the QuoteModel - key: vehicleMake,
      • Vehicle model - sourced from AutoDetailsData - which is populated from the Map of values on the QuoteModel - key: vehicleModel,
      • Year of Manufacture - sourced from AutoDetailsData - which is populated from the Map of values on the QuoteModel - key: vehicleYear,
      • State - sourced from AutoDetailsData - which is populated from the Map of values on the QuoteModel - key: state,
      • Date of Birth - sourced from AutoDetailsData - which is populated from the Map of values on the QuoteModel - key: driverDob,
      • Vehicle Value - sourced from AutoDetailsData - which is populated from the Map of values on the QuoteModel - key: vehicleValue
    • Column 2
      • The Insurance Type - Order.entry.product.defaultCategory
      • Start Date - Sourced from AutoDetailsData - which is populated from the Map of values on the QuoteModel - key: coverageStartDate.
  • Page 4 - Benefits

Benefits are extracted from the product's price plan if the product's price plan is a subscription price plan. The benefits are those pricePlanData.oneTimeChargeEntries whose entry.billingTime.code is not the paynow code. The benefit contains:

    • Name
    • Coverage Value
    • Description
  • Page 5 - Frequently Asked Questions
  • Page 6 - Claims
    • Contact Us
  • Page 7 - Closing Policy Page
    • Image
    • Further contact details

PDF Setup

The templateId is used to find the Template for populating the PDF.

# CMS components velocity templates

INSERT_UPDATE
            RendererTemplate;code[unique=true];contextClass;rendererType(code)[default='velocity']
            ;insurances_travel;$xslfoPackageName.TravelPolicyContext;

# CMS components and Email velocity templates

UPDATE
            RendererTemplate;code[unique=true];description[lang=$lang];templateScript[lang=$lang,translator=de.hybris.platform.commerceservices.impex.impl.FileLoaderValueTranslator]
            ;insurances_travel;"XslFo TravelPolicy
            Template";$jarResourceXslFoInsurance/xslfo-travelPolicy_$lang.vm