Configuring database search criteria in Gosu

You can add criteria to searches that use either Gosu classes or virtual entities.

In the base PolicyCenter configuration, Guidewire provides Gosu classes to configure database search for a number of entity types. The following table lists some entity types for which users can search and the Gosu classes that you modify to configure the user interface for that type of search.

Entity type to search

Gosu search criteria class

Account

gw.account.AccountSearchCriteria

Activity

gw.account.ActivitySearchCriteria

Claim

gw.losshistory.ClaimSearchCriteria

IndustryCode

gw.product.IndustryCodeSearchCriteria

History

gw.history.HistorySearchCriteria

PolicyPeriod

gw.policy.PolicyPeriodSearchCriteria

Guidewire also provides a Gosu enhancement that you can use to configure searches for Contact objects.

gw.plugin.Contact.ContactSearchCriteriaEnhancement.gsx

To improve contact search, Guidewire adds fields to the Contact entity as denormalization fields from the Address entity. These fields include:

  • CityDenorm
  • Country
  • PostalCodeDenorm
  • State
Warning: Guidewire strongly recommends that you consider all the implications before customizing any search configuration object. Adding new search criteria can result in significant performance impacts, particularly in large databases. Guidewire recommends that you thoroughly test any search customizations for performance issues before you move them into a production database.

See also

Adding a new optional search field to a Gosu class search

To expand the search capabilities of a Gosu search criteria class with additional optional search criteria, you do the following general tasks:

  1. Declare the variable in the Gosu class definition file.
  2. Add a field in the PCF file that maps to that variable.
  3. Incorporate the variable into the query defined within the Gosu search object class definition file.

Add an optional search field to a Gosu class search

About this task

The following example adds a new field to the Activity Search PCF, and then incorporates the field into the query in ActivitySearchCriteria.

Procedure

  1. Open ActivitySearchCriteria.gs for editing in Guidewire Studio.
  2. Navigate to the definitions of search criteria.

    In the base configuration, these definitions look like the following lines.

    var _policyNumber : String as PolicyNumber
    var _accountNumber : String as AccountNumber
    var _overdueNow : Boolean as OverdueNow
    var _activityStatus : ActivityStatus as SearchedActivityStatus
    var _priority : Priority as SearchedPriority
    var _assignedUser : User as SearchedAssignedUser 
  3. Add the following line at the end of this list.
    var _recurring : Boolean as Recurring
  4. Add a display key for the Recurring field label:
    1. Navigate in the Project window to configuration > config > Localizations > Resource Bundle 'display' and double-click display.properties to open this file in the editor.
    2. Find the display key entries that begin with Web.ActivitySearch, and add the following line.
      Web.ActivitySearch.Recurring = Recurring
  5. Add a widget for the new search field to the user interface.
    1. Open ActivitySearchDV for editing in Studio.
    2. Add an Input widget in the optional section directly under the Overdue Now field.
    3. Enter the following values for this widget in the Properties area at the bottom of the screen.

      editable

      true

      id

      Recurring

      label

      displaykey.Web.ActivitySearch.Recurring

      required

      false

      value

      searchCriteria.Recurring

    PolicyCenter defines variable searchCriteria for this PCF file under Required Variables. To see the definition of this variable, select the entire DetailViewPanel and then select the Required Variables tab. You see the following variable definition in the base configuration.

    name

    searchCriteria

    type

    gw.activity.ActivitySearchCriteria

  6. Add the new search field to the search query.
    1. Open ActivitySearchCriteria.gs for editing.
    2. Add the following code to the list of if statements in the makeQuery function.
      if (Recurring != null) {
        query.compare("Recurring",Equals , Recurring)
      }
  7. Stop and restart the application server.
  8. If your installation does not include a recurring activity, create one:
    1. Open a currently active policy.
    2. Select New Activity from the Actions menu, set Recurring to Yes, and redo the search.
  9. Test your search screen by doing the following:
    1. Open PolicyCenter and navigate to the Search > Search Activities screen.
    2. Perform an activity search, setting Recurring to Yes.

Adding an optional search field to a virtual entity search

To expand the search capabilities of a virtual search entity type with additional optional search criteria, you need to do the following general tasks. In the following instructions, replace Entity with the entity type that you need to modify.

  1. Extend the EntitySearchCriteria object and add your search field to it as an extension column. For example, add a column to the EntitySearchCriteria extension (EntitySearchCriteria.etx).
  2. Add widgets for the additional search criteria fields to the search screen PCF file.
  3. Modify EntitySearchCriteriaEnhancement.gsx by adding the new search criteria.

The following table lists PolicyCenter files and tasks that you use in modifying a search that uses virtual entities.

File

Task

search-config.xml

Add a CriteriaDef element for the search entity. PolicyCenter uses this for the SearchObjectType in EntitySearchScreen.pcf.

EntitySearchScreen.pcf

Examine the values of the following properties. These properties determine the classes and methods that you need to modify.

SearchPanel: Properties

  criteriaName: searchCriteria

  searchCriteria: new EntitySearchCriteria()

  search: searchCriteria.performSearch()

If the search screen supports multiple entity types, you see a range input widget similar to the following one. The value property determines the classes and methods that you need to modify.

SearchFor: Properties

  value: searchCriteria.SearchObjectType

This PCF file also contains fields for all searchable criteria. Add your new search fields to this file.

EntitySearchCriteria.eti

Base configuration data model definitions for standard fields on the EntitySearchCriteria object. You cannot modify this base configuration file.

EntitySearchCriteria.etx

Base configuration enhancement fields on the EntitySearchCriteria object. Modify this file and add your new search configuration criteria.

EntitySearchCriteriaEnhancements.gsx

Modify the search method.