Methods that remove a location from a policy line

The policy line includes methods for removing a location from a policy line. These methods must account for earlier policy periods and future policy periods caused by out-of-sequence changes.

The policy line methods are defined in the gw.api.policy.AbstractPolicyLineMethodsImpl class. The methods related to removing a location include the following:

Method

Description

canSafelyDeleteLocation

Determines whether the location can be safely deleted. Use this method with line-specific location screens. For example, the location screen can call this method to determine whether to enable the Remove button. In the base configuration, this method applies to line-specific locations but not the corresponding PolicyLocation in a multi-line package product. The Remove button on the Locations screen deletes a line-specific location, such as BALocation or BOPLocation.

checkLocationInUse

Determines which locations can be removed during quote. Quoting removes any PolicyLocation objects that this method reports as not in use. In the base configuration, PolicyCenter removes PolicyLocation objects but not line-specific locations. The implementation assumes that the line-specific locations have been removed through the canSafelyDeleteLocation method on the Locations screen user interface. The checkLocationInUse method removes obsolete locations created:

  • In products without a Locations screen.
  • In package products with separate screens for policy-wide PolicyLocation objects and line-specific locations.

preLocationDelete

PolicyCenter calls this method before a location is deleted. Use this method to cleanup the policy location or update the data model.

canSafelyDeleteBuilding

Determines whether a building can be safely deleted.

Use the checkLocationInUse and canSafelyDeleteLocation methods to determine whether a location can be deleted from a policy line. In the NoOpPolicyLineJavaMethodsImpl class, these methods check to make sure that the primary location is not deleted. Each line of business overrides these methods in its linePolicyLineMethods.gs implementation.

While the checkLocationInUse and canSafelyDeleteLocation methods are similar, there is an important difference in how they are intended to be used. In some lines of business, the canSafelyDeleteLocation and checkLocationInUse methods are the same. For example, the methods can check whether there are coverages attached or coverables located at the location. However, in some lines of business the methods must perform different operations. Therefore, two methods are provided.