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

  1. Start Guidewire Studio™ for ContactManager.

    At a command prompt, navigate to the ContactManager installation folder and enter the following command:

    gwb studio
  2. In the Project window, navigate to configuration > config > Extensions > Entity, and then right-click Entity and choose New > Entity.
  3. Enter the following file name: ContactServiceState
  4. Enter the following for Desc:
    Represents a state where the contact provides services
  5. In addition to Extendable and Final, which are already selected, select the Exportable check box.
  6. Click OK.
  7. In the editor, click entity at the top of the Element hierarchy
  8. Click the drop-down list for and choose implementsEntity, and then choose ABLinkable from the drop-down list for the name value.
  9. 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.
  10. 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.

  11. 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:

  12. Click entity at the top of the Element hierarchy.
  13. 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
  14. Click entity at the top of the Element hierarchy.
  15. 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)
  16. Click entity at the top of the Element hierarchy.
  17. Click the drop-down list next to and choose index.
  18. Enter the following values for the new index:
    Name Value
    name absrvstatelinkid
    desc Preserve uniqueness of LinkID
    unique true
  19. Right-click index in the Element column, and choose Add new > indexcol.

    This index column is the first of two to add to the index.

  20. Enter the following values for the new indexcol:
    Name Value
    name LinkID
    keyposition 1
  21. Right-click index in the Element column, and choose Add new > indexcol.
  22. Enter the following values for the new indexcol:
    Name Value
    name Retired
    keyposition 2
  23. Click entity at the top of the Element hierarchy.
  24. Click the drop-down list next to and choose index.
  25. Enter the following values for the new index:
    Name Value
    name ind1
    unique true
  26. Right-click the ind1 index in the Element column, and choose Add new > indexcol.
    This index column is the first of three to add to the index.
  27. Enter the following values for the new indexcol:
    Name Value
    name ServiceState
    keyposition 1
  28. Right-click the ind1 index in the Element column, and choose Add new > indexcol.
  29. Enter the following values for the new indexcol:
    Name Value
    name Retired
    keyposition 2
  30. Right-click the ind1 index in the Element column, and choose Add new > indexcol.
  31. Enter the following values for the new indexcol:
    Name Value
    name ContactID
    keyposition 3
  32. Click entity at the top of the Element hierarchy.
  33. Click the drop-down list next to and choose index.
  34. Enter the following values for the new index:
    Name Value
    name ind2
    unique true
  35. Right-click the ind2 index in the Element column, and choose Add new > indexcol.
    This index column is the first of three to add to the index.
  36. Enter the following values for the new indexcol:
    Name Value
    name ContactID
    keyposition 1
  37. Right-click the ind2 index in the Element column, and choose Add new > indexcol.
  38. Enter the following values for the new indexcol:
    Name Value
    name Retired
    keyposition 2
  39. Right-click the ind2 index in the Element column, and choose Add new > indexcol.
  40. Enter the following values for the new indexcol:
    Name Value
    name ServiceState
    keyposition 3

What to do next

Add the new array to the ABContact entity