Define coverage entity for coverable

About this task

The coverable objects need coverage entities. The Golf Cart line has two coverable objects, GolfCartLine and GOCart. The following steps explain how to define the GolfCartLineCov entity that provides coverage for the GolfCartLine.

Procedure

  1. In Studio, create the new coverage entity for the coverable object. In the entity element:
    • Set the table attribute to the name of the coverage in lower case letters.
    • Set the type attribute to effdated.
    • Set the effDatedBranchType attribute to PolicyPeriod.
    For Golf Cart, create the GolfCartLineCov entity. In the Entity editor window, with the entity element selected, set the following properties:

    Property

    Value

    table

    golfcartlinecov

    type

    effdated

    effDatedBranchType

    PolicyPeriod

    exportable

    true

  2. Add a foreign key to the coverable.
    For Golf Cart, add a foreignkey element to GolfCartLine.

    Property

    Value

    name

    GOLine

    fkentity

    GolfCartLine

    nullok

    false

  3. Add coverage terms as columns in the coverage entity. (The previous topic explained how to specify the number and types of coverage terms required.) Add a coverage term for each type that can be used in this coverage. Add the maximum number coverage terms for each coverage term type. The name for each coverage term must be unique among coverage terms. For example, you can set the name of the first direct coverage term to DirectTerm1, and the name of the second to DirectTerm2.
    For the Golf Cart line, you can add the following to the coverage term table:
    • Two direct coverage terms
    • One choice coverage term
    • One Boolean coverage term

Example

The following XML code represents a typical, complete coverage entity definition for GolfCartLineCov:

<?xml version="1.0"?>
<!--Golf Cart Line Coverage-->
<entity
  xmlns="http://guidewire.com/datamodel"
  desc="A line-level coverage for Golf Cart Line"
  effDatedBranchType="PolicyPeriod"
  entity="GolfCartLineCov"
  exportable="true"
  final="false"
  platform="false"
  table="golfcartlinecov"
  type="effdated">
  <foreignkey fkentity="GolfCartLine" name="GOLine" nullok="false"/>
<column name="DirectTerm1"
          nullok="true"
          type="decimal" desc="direct covterm field"
          getterScriptability="doesNotExist" setterScriptability="doesNotExist">
    <columnParam name="scale" value="4"/>
    <columnParam name="precision" value="20"/>
  </column>
  <column name="DirectTerm1Avl"
          nullok="true"
          type="bit" getterScriptability="doesNotExist"
          setterScriptability="doesNotExist"
          desc="whether or not the DirectTerm1 field was available the last time
      availability was checked"/>
  <column name="DirectTerm2"
          nullok="true"
          type="decimal" desc="direct covterm field"
          getterScriptability="doesNotExist" setterScriptability="doesNotExist">
    <columnParam name="scale" value="4"/>
    <columnParam name="precision" value="20"/>
  </column>
  <column name="DirectTerm2Avl"
          nullok="true"
          type="bit" getterScriptability="doesNotExist"
          setterScriptability="doesNotExist"
          desc="whether or not the DirectTerm2 field was available the last time
      availability was checked"/>
  <column name="ChoiceTerm1"
          nullok="true"
          type="patterncode" desc="choice covterm field"
          getterScriptability="doesNotExist"
          setterScriptability="doesNotExist"/>
  <column name="ChoiceTerm1Avl"
          nullok="true"
          type="bit"
          desc="whether or not the ChoiceTerm1 field was available the last time
      availability was checked"
          getterScriptability="doesNotExist" setterScriptability="doesNotExist"/>
  <column name="BooleanTerm1"
          nullok="true"
          type="bit" desc="boolean covterm field"
          getterScriptability="doesNotExist" setterScriptability="doesNotExist" />
  <column name="BooleanTerm1Avl"
          nullok="true"
          type="bit" getterScriptability="doesNotExist"
          setterScriptability="doesNotExist"
          desc="whether or not the BooleanTerm1 field was available the last time
      availability was checked"/>
</entity>

What to do next

Link the coverable to the coverage