Create policy line methods
Before you begin
About this task
Within PolicyCenter, each line of business requires a set of policy line methods. For lines of business in the base configuration, these methods are already defined. For a custom policy line, two extra steps are required. The first step is to use a delegate to declare the methods. The second step is to create a Gosu class in Studio that implements the methods. The delegate declaration references the Gosu class. Previously, you defined the policy line element in Create coverable entities. At that time, you specified the delegate in the implementsInterface element.
Adding the policy line methods is a reasonably simple task. In part, it is simple because the same methods exist for all other lines, including the policy lines included in the base configuration. As you write the code for your policy line, use the code for the existing lines as an example. You can view the existing policy line methods in Studio by navigating to where xx is the line abbreviation. For example, the policy line methods for commercial auto are in gw.lob.ba.BAPolicyLineMethods.gs located in .
Procedure
-
In Studio, navigate in
to the
gw.lob.line package.For Golf Cart, navigate to thegw.lob.gopackage. -
Right-click the
gopackage node, and then select . In the New Gosu Class dialog box, enter the class Name. Enter the name from theimplattribute of theimplementsInterfaceelement of the policy line element. For Golf Cart, enter GOPolicyLineMethods. -
In the Gosu class, change the class declaration to show that this class extends
the policy line methods.
For Golf Cart, modify the class statement as follows:
package gw.lob.go uses gw.api.policy.AbstractPolicyLineMethodsImpl class GOPolicyLineMethods extends AbstractPolicyLineMethodsImpl { construct() { } } -
Modify the base construct using an existing policy line as an example.
For Golf Cart, modify the base construct as follows:
class GOPolicyLineMethods extends AbstractPolicyLineMethodsImpl { var _line : entity.GolfCartLine construct(line : entity.GolfCartLine) { super(line) _line = line }This code produces a Gosu error in the class statement that you fix in the next step. -
Place the insertion point at the error (after
AbstractPolicyLineMethodsImpl) and press Alt-Enter. Click the ImplementMethods command that pops up to open the Select Methods to Implement dialog box. With all listed methods selected, click OK to insert the empty methods into your code. -
Write code for the new methods and properties.
Use other lines of business, such as General Liability, as an example. For example, most lines of business delegate to
CoverableandModifiableentities. For the types of additions you must make, see the GeneralLiabilityLine entity definition and Gosu classes.Note: You can revise these properties as needed as you add coverages and other covered objects to the line. - At this point, you can verify your work. For instructions, see Verify your work.
Results
Because you have not defined other entities in the line, there are very few methods that you can create at this point.
