Add a cost adapter

Before you begin

Declare cost adapter in abstract cost

Procedure

  1. In Studio, navigate in configuration > gsrc to the gw.lob.line package. For Golf Cart, navigate to gw.lob.go.
  2. Right-click the line node, and then select New > Package. In the New Package dialog box, enter a new package name of financials.
  3. Right-click the new financials package, and then select New > Gosu Class. In the New Gosu Class dialog box, enter the name of the adapter. You specified the name of the adapter in the implementsEntity element of the abstract cost entity. For Golf Cart, enter GOCostAdapter.
  4. In the new Gosu class, write a constructor similar to the following for the gw.lob.go.GOCostAdapter:
      package gw.lob.go.financials
      uses gw.api.domain.financials.CostAdapter
      
      class GOCostAdapter implements CostAdapter {
        var _owner : GOCost  
        construct(owner : GOCost)
        {
          _owner = owner
        }
      }

    This code produces a Gosu error in the class statement that you fix in the next step.

  5. Place the insertion point at the error (after CostAdapter) 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.
  6. Write code for the new methods and properties. In most cases, the code for each method is a single line. Examine the cost adapters for other lines of business as an example.

What to do next

Declare transaction adapter in the transaction entity