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.
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
-
In Studio, navigate to .
Then right-click Entity node and
select . 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. -
In GolfCartLine.eti,
set
displayNameto the value Golf Cart Line. -
Add the following elements to the
GolfCartLinesubtype.-
If the
line is a coverable object, add a
ReferenceDateInternalfield as acolumnelement. Add the field by adding a newcolumnelement with the following properties:Property
Value
nameReferenceDateInternal
typedatetime
nulloktrue
descInternal field for storing the reference date of this entity on bound policy periods.
-
In the entity, add a delegate that implements
gw.api.policy.PolicyLineMethods. For the Golf Cart line, the delegate isgw.lob.go.GOPolicyLineMethods. To add the delegate, add animplementsInterfaceelement to the subtype with the following properties:Property
Value
iface
gw.api.policy.PolicyLineMethods
impl
gw.lob.go.GOPolicyLineMethods
For more information, see <implementsInterface>.
-
Optional.
Add additional columns or other elements as needed. For example, as you
define the GOCart entity,
add a
foreignkeyelement that points back to the GolfCartLine entity. On the GolfCartLine entity, define aonetooneelement 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>
-
If the
line is a coverable object, add a
-
Add the other entities needed for the Golf Cart line, as shown in the object model
diagram.
Note: Unlike
GolfCartLine,GOCartis not an entity subtype of another entity. DefineGOCartas anentityrather than as asubtype.
