In Guidewire development, the preferred way to extend base entities with business logic or derived data is throughGosu Enhancements. This approach allows you to add properties or methods to an entity that appear as if they were part of the original class.
1. Enhancement Location and Package (Option A)
According to theGuidewire InsuranceSuite Developer Fundamentalsguide, any custom enhancement must be placed in acustomer-specific package(e.g., si.pc.contact for Succeed Insurance). Using the gw package (Options D and E) is strictly prohibited as it is reserved for Guidewire's internal product code. Because "Date Established" is specific to the Company entity (as indicated in the Contact hierarchy), the enhancement should target the Company entity directly.
2. Using a Getter Property (Option G)
The requirement is to "calculate" a value based on existing data. The most efficient and readable way to implement this in Gosu is via agetter property(property get). Unlike a standard function (Option B), a getter property allows you to access the value in PCFs or rules using simple dot notation (e.g., myCompany.YearsInBusiness_Ext), making the code cleaner and more maintainable.
Why other options are incorrect:
Option B:While a function would technically work, a getter property is the best practice for a value that logically represents a "read-only" attribute of the entity.
Option C:Asetteris used towritedata to a field. Since "Years in Business" is a derived calculation, it should not be manually set; it should be calculated on-the-fly from the source date fields.
Options D and E:As mentioned, these use the gw package, which violates upgrade-safety standards and would cause the "Cloud Assurance" checks to fail.
By creating a Company enhancement in the customer's package and providing a property get, the developer creates a reusable, performant solution that follows the platform's core architectural principles.
Submit