Create coverable entities

About this task

Create an entity for the new policy line. In this example, the policy line is a coverable object. For the Golf Cart line of business, the PolicyLine subtype is GolfCartLine.

Note: For detailed instructions on how to create new entities see Defining a new data entity.

Create the new policy line entity. For Golf Cart, create the GolfCartLine entity. These steps create the basic entity definition. Add additional columns and data objects as needed after the verifying the basic definition.

Procedure

  1. In Studio, navigate to configuration > config > Extensions. Then right-click Entity node and select New > Entity. In the Entity dialog box, enter the following properties:

    Property

    Value

    Entity

    This parameter corresponds to the desc parameter you specified in Register the new line of business when you added a new typelist extension named InstalledPolicyLine.GO.ttx. For the Golf Cart example, enter GolfCartLine.

    Entity Type

    subtype

    Desc

    Golf Cart line of business

    Supertype

    PolicyLine

    Studio creates GolfCartLine.eti.
  2. In GolfCartLine.eti, set displayName to the value Golf Cart Line.
  3. Add the following elements to the GolfCartLine subtype.
    1. If the line is a coverable object, add a ReferenceDateInternal field as a column element. Add the field by adding a new column element with the following properties:

      Property

      Value

      name

      ReferenceDateInternal

      type

      datetime

      nullok

      true

      desc

      Internal field for storing the reference date of this entity on bound policy periods.

    2. In the entity, add a delegate that implements gw.api.policy.PolicyLineMethods. For the Golf Cart line, the delegate is gw.lob.go.GOPolicyLineMethods. To add the delegate, add an implementsInterface element to the subtype with the following properties:

      Property

      Value

      iface

      gw.api.policy.PolicyLineMethods

      impl

      gw.lob.go.GOPolicyLineMethods

      For more information, see <implementsInterface>.

    3. Optional. Add additional columns or other elements as needed. For example, as you define the GOCart entity, add a foreignkey element that points back to the GolfCartLine entity. On the GolfCartLine entity, define a onetoone element that provides access to the GOCart entity.
      If you switch to the Text tab of the Entity editor, the code in the GolfCartLine.eti file appears similar to the following:
      <?xml version="1.0"?>
      <subtype
        xmlns="http://guidewire.com/datamodel"
        entity="GolfCartLine"
        desc="Golf Cart line of business"
        supertype="PolicyLine">
        <column
          desc="Internal field stores the reference date of this entity on bound policy periods"
          name="ReferenceDateInternal"
          nullok="true"
          type="datetime"/>
        <implementsInterface
          iface="gw.api.policy.PolicyLineMethods"
          impl="gw.lob.go.GOPolicyLineMethods"/>
      </subtype> 
  4. Add the other entities needed for the Golf Cart line, as shown in the object model diagram.
    Note: Unlike GolfCartLine, GOCart is not an entity subtype of another entity. Define GOCart as an entity rather than as a subtype.

What to do next

Create policy line methods