Cloud Retrofit with APD App

Users that have the APD App can use the following steps to generate LOB-specific endpoints for products that were not created in APD.
After reading this topic, you'll be able to:
  • Define the product with template configuration files.
  • Use PolicyCenter to export the product template to a ZIP file.
  • Create the product from the template in the APD app.
  • Create or modify the codegen file, as needed.
  • Use PolicyCenter to generate the endpoints.
  • Delete the product from the APD App.

Instructions

Step 1: Define the product in the template configuration files

About this task

Template gen config files allow you to change default values and define configuration details that cannot be automatically inferred from the data model when generating the REST APIs.

Procedure

  1. Using any editor, create an outline of the entities associated with the line of business. Creating a diagram is optional.
    1. Start at PolicyLine.eti and find the subtype for the LOB.
    2. Document the arrays, foreign keys, one-to-ones, and autonumber sequences.
    3. Repeat the process for any entities referenced using arrays, foreign keys, or one-to-ones that are LOB-specific and that do not represent Clauses, ScheduledItems, Modifiers, Answers, PolicyContactRoles, Costs, or Transactions.
  2. If you want to generate endpoints for a LOB that was included in the base configuration of a previous release, you need to remove its associated LOB-specific entries from the template_gen_config.xml. Guidewire provides default entries in the template_gen_config.xml file to facilitate Cloud Retrofit for users that do not have the APD App.
    1. In Studio, open the template_gen_config.xml
    2. Search for a PolicyLine XML node for the LOB. For example, you can search for <PolicyLine code="PersonalAutoLine">.
    3. Delete the entries for the LOB.
      Note: Do not remove existing PolicyLine entries for LOBs that you are not generating endpoints with using this particular process.
  3. Create a template_gen_config.lob_prefix.yaml file in the modules/configuration/config/apd/model/generate/json/ folder.
    Note: The lob_prefix is the code for the line that is found in the InstalledPolicyLine typelist. For consistency with YAML files in the base configuration, we recommend using the lowercase version of the line prefix. Guidewire may have a YAML file available for the LOB. Contact your Guidewire representative for support.
  4. Edit the template_gen_config.lob_prefix.yaml file to address the following scenarios from the line policy graph outline or diagram.
    1. Add each entity that has an autoNumberSequence to the file.
    2. Add each entity that does not implement the Coverable interface to the file.
      • If the entity has child arrays, specify that the entity must be handled as a coverable: handling: coverable.
      • If the entity has no child arrays, specify that the entity must be handled as an exposure: handling: exposure. Subtypes of AddlInterestDetail, for example PAVhcleAddlInterest, are treated as exposures and do not have to be listed explicitly for JSON template generation.
    3. Add an override for each field that has the name of a reserved keyword.
      Use the fieldName property to give a field a different name in the APD model, thereby generating an override so that the field's name is not changed during entity code generation. Any generated code still refers to the actual field name. For example, the OOTB WCWaiverOfSubro entity has a field with a name of Type, which is not a legal field name in APD. The following entry overrides this field name with WaiverType:
      WCWaiverOfSubro:
         handling: exposure
         fields:
           Type:
             fieldName: WaiverType
    4. As needed, make additional modifications such as:
      • Choose handling as exposure, coverable, or location.
      • Set an entity as ignored.
      • Add a typeName.
      • Add entries for auto sequence numbers.
  5. Optional: Edit the template_gen_config.all.yaml file to ignore NumAddInsured.
    1. In Studio, open the file template_gen_config.all.yaml.
    2. As part of the PolicyLine entity, add an entry to ignore the NumAddInsured field so that it is not generated as an APD attribute of the LOB. Add the last two lines of the following code snippet:
      PolicyLine:
         fields:
            PatternCode:
               ignored: true
            NumAddInsured:
               ignored: true
      This field was not used in the LOBs that were included in the base configuration of previous releases, so it is unlikely that there are any occurrences.
  6. Edit or create the lob_prefix_codegen_config_ext-1.0.yaml file.
    This file is used for generating the LOB-specific endpoints.
    1. Verify the contents of the file and make sure it is compatible with any changes to the product and the template generator configuration.
    2. Make sure the file complies with the rules for codegen config file syntax.

Step 2: Export the product

Procedure

  1. In PolicyCenter, select Administration > Product Management. Then, select the Externally Managed tab.
  2. Select the LOB and select Export Product.
    Selecting Export Product creates and exports a JSON representation of the LOB. A ZIP file with the name of the LOB is saved to your Downloads folder.
  3. Check the server log for errors and warnings and address them.
    Review the server log for errors and warnings, and specifically for WARN Application.APD messages that are output as part of generating the JSON template. These warnings include information about pieces of the product that appear to be missing appropriate configuration in template_gen_config.lob_prefix.yaml, for example children that are not configured as coverables or exposures, field names that are not compatible with APD, and other problems that may occur during code generation. For example, you might see the error message The field name Type is not a legal APD field name. Use the template_gen_config file to add an appropriate override for the field name to something legal.
  4. Export the product again and check the server log for any remaining warnings or errors.
  5. Save the LOB template ZIP file for your records.

Step 3: Create a new product in APD App

Procedure

  1. On the Insurance Products page of the APD App, select Create New Product.
  2. Select the From Template tab.
  3. Select the LOB template ZIP file.
  4. Select Create.
    A tile for the new product appears.

Step 4: Create or modify the codegen config file

A codegen config file is a file that provides PolicyCenter with information about how to generate LOB-specific endpoints for a given non-APD-native product. For more information, see Codegen config files.

Step 5: Synchronize PolicyCenter with APD and generate the endpoints

Before you begin

In PolicyCenter Preferences, set the Product Design Mode to Developer.

Procedure

  1. In PolicyCenter, select Administration > Product Management. Then, select the APD Managed tab
  2. Click Synchronize With Cloud or click Import From Cloud and type the product identifier.
    To find the product identifier:
    1. In APD, click the product's tile to display the product.
    2. In the Navigation pane, select the product node.
    3. Click View [Product Name].
      Product Identifier appears in Element Details and also in the URL.
  3. Select the product from the list.
  4. Generate the product code.
    1. Click Generate Product Code.
    2. Review the warnings at the top of the screen and in the list of elements. Perform updates to the codegen config file,as needed.
    3. In Generate Options, verify that the System APIs - Code is set to Default Directory.
    4. Click Complete Generation and then click OK to confirm.
      The following message appears: Code has been successfully generated.

Step 6: Delete the product from APD App

About this task

While you can use the APD App to generate the endpoints, the product cannot be maintained in the APD App. Therefore, delete the product from APD App after you successfully generate the endpoints.

Procedure

  1. On the Insurance Products page of the APD App, locate the tile associated with the product you want to delete.
  2. From the ... menu of the product you want to delete, select Remove product.

Results

Removing this product from the APD App is done to avoid confusions between products that can be maintained in the APD app and those that you add to the APD App to facilitate the generation of endpoints.

Next steps

  • To view the generated endpoints, restart the PolicyCenter server. For information on how to access the endpoints, see PolicyCenter Cloud API Consumer Guide
  • To regenerate the endpoints, verify that the product is no longer in the APD App and then repeat the steps in this procedure.