Update policy line methods for the new coverages

About this task

After Creating the coverage adapter, make a change in PolicyLineMethods to support the new policy line coverages. Add the following:

  • The AllCoverage property
  • Other properties and methods as needed

To add the property for all coverages:

Procedure

  1. In Studio, open the gw.lob.package.linePolicyLineMethods class that you created in configuration > gsrc.
    For Golf Cart, open gw.lob.go.GOPolicyLineMethods.gs.
  2. Define the get AllCoverages property.
    Using Golf Cart as an example, if the policy line coverages are the only coverages within the policy line, then the following code is sufficient:
    override property get AllCoverages() : Coverage[] {
      return _line.GOLineCoverages 
    }
    If you added coverages to other objects, you can use code similar to the following example. This example for the Golf Cart line adds coverages from the line and coverages from golf carts:
    uses java.util.ArrayList
    ...
    override property get AllCoverages() : Coverage[] {
      var coverages = new ArrayList<Coverage>()
      coverages.addAll( _line.CoveragesFromCoverable.toList())
      // add for each golf cart
      coverages.addAll( _line.GOCart.Coverages.toList())
      return coverages as Coverage[]
    }
    Note: This code adds the line and golf cart coverages together by converting them to a linked list, because it is easier to add linked lists than to add arrays.
  3. Define other properties and methods as needed.
  4. At this point, you can verify your work. For instructions, see Verify your work.