Add search support in ContactManager for Guidewire core applications
Add code for the new InterpreterSpecialty field to the Gosu class ABContactAPISearchCriteria. This Gosu object is populated by the core application to pass a search criterion to ContactManager.
Before you begin
About this task
For this example, the new field will be added to the search results that ContactManager sends back to the Guidewire core application. To add the field, you enter code for the field in the Gosu class ABContactAPISearchResult.
Procedure
-
Add an entry for InterpreterSpecialty to the class ABContactAPISearchCriteria.
- In Guidewire Studio for ContactManager, navigate in the Project window to and then to gw.webservice.ab.ab1000.abcontactapi.
- Double-click ABContactAPISearchCriteria to open the class in the editor.
-
Add the following variable definition to the list of variables at the beginning of the class.
public var InterpreterSpecialty : String -
In the method toSearchCriteria, before
:AllTagsRequired, add the following entry::InterpreterSpecialty = this.InterpreterSpecialty,
-
If you want the field to be added to the search results sent back to a Guidewire core application, add an entry
for InterpreterSpecialty to the class ABContactAPISearchResult.
- Press Ctrl+N and enter ABContactAPISearchResult.
- Click the class with package gw.webservice.ab.ab1000.abcontactapi in the search results to open the class in the editor.
-
Add the following variable definition to the list of variables at the beginning of the class.
public var InterpreterSpecialty : String -
In the constructor construct(contact : ABContact), find the
ifstatement block for ABPerson:if (contact typeis ABPerson) { -
After that
ifstatement block, add a newifstatement for ABInterpreter, as follows:// Search results for ABInterpreter if (contact typeis ABInterpreter) { this.InterpreterSpecialty = contact.InterpreterSpecialty }
