Create a service state entity in ContactManager
Part of extending contacts with an array is to create the entity that will be in the array.
About this task
This step is the first in the example described at Extending contacts with an array. In this step, you add an entity to ContactManager representing a state in which a contact provides service.
Procedure
-
Start Guidewire Studio™ for ContactManager.
At a command prompt, navigate to the ContactManager installation folder and enter the following command:
gwb studio - In the Project window, navigate to , and then right-click Entity and choose .
- Enter the following file name: ContactServiceState
-
Enter the following for Desc:
Represents a state where the contact provides services
- In addition to Extendable and Final, which are already selected, select the Exportable check box.
- Click OK.
- In the editor, click entity at the top of the Element hierarchy
-
Click the drop-down list for
and choose implementsEntity, and then choose ABLinkable from the drop-down list
for the name value.
-
Click the drop-down list for
and choose implementsEntity, and then choose Extractable from the drop-down list
for the name value.
Choosing Extractable makes the entity part of the ABContact entity graph. If you implement personal data destruction, being part of the entity graph makes it possible to destroy the entity if necessary. See Extensions of ABContact and other entities and the domain graph. -
Click the drop-down list for
and choose implementsEntity, and then choose Obfuscatable from the drop-down list
for the name value.
Choosing Obfuscatable makes it possible to obfuscate the entity as part of personal data destruction. See Implementing the Obfuscatable delegate in an entity.
-
Click the drop-down list for
and choose implementsInterface.
Enter the following values:
- For iface, enter gw.api.obfuscation.Obfuscator.
- For impl, enter gw.personaldata.obfuscation.DefaultPersonalDataObfuscator.
This step specifies how fields of the entity will be obfuscated. See:
- Click entity at the top of the Element hierarchy.
-
Click the drop-down list for
and choose foreignKey, and then enter the following values:
Name Value name Contact fkentity ABContact nullok false columnName ContactID desc Contact that this Service State row relates to - Click entity at the top of the Element hierarchy.
-
Click the drop-down list for
and choose typekey, and then enter the following values:
Name Value name ServiceState typelist State nullok false desc State serviced by the contact exportable true (default value) loadable true (default value) - Click entity at the top of the Element hierarchy.
-
Click the drop-down list next to
and choose index.
-
Enter the following values for the new index:
Name Value name absrvstatelinkid desc Preserve uniqueness of LinkID unique true -
Right-click index in the Element column, and choose .
This index column is the first of two to add to the index.
-
Enter the following values for the new
indexcol:Name Value name LinkID keyposition 1 - Right-click index in the Element column, and choose .
-
Enter the following values for the new
indexcol:Name Value name Retired keyposition 2 - Click entity at the top of the Element hierarchy.
-
Click the drop-down list next to
and choose index.
-
Enter the following values for the new index:
Name Value name ind1 unique true -
Right-click the ind1 index in the Element column, and choose .
This index column is the first of three to add to the index.
-
Enter the following values for the new
indexcol:Name Value name ServiceState keyposition 1 - Right-click the ind1 index in the Element column, and choose .
-
Enter the following values for the new
indexcol:Name Value name Retired keyposition 2 - Right-click the ind1 index in the Element column, and choose .
-
Enter the following values for the new
indexcol:Name Value name ContactID keyposition 3 - Click entity at the top of the Element hierarchy.
-
Click the drop-down list next to
and choose index.
-
Enter the following values for the new index:
Name Value name ind2 unique true -
Right-click the ind2 index in the Element column, and choose .
This index column is the first of three to add to the index.
-
Enter the following values for the new
indexcol:Name Value name ContactID keyposition 1 - Right-click the ind2 index in the Element column, and choose .
-
Enter the following values for the new
indexcol:Name Value name Retired keyposition 2 -
Right-click the
ind2index in the Element column, and choose . -
Enter the following values for the new
indexcol:Name Value name ServiceState keyposition 3
