There is a requirement for an additional filter on Desktop Activities. The filter requires a complex query. Which option will meet the requirement and follow best practices?
A.
Use a Gosu query with a " where " clause to find the needed rows, then pass the results to the filter.
B.
Use a " for " loop with an " if " statement to find the needed rows, then pass the results to the filter.
C.
Create a function using a Gosu query and a subselect clause, then call that function from the filter property.
D.
Create a function using a Gosu query and compare clauses, then call that function from the filter property.
In Guidewire InsuranceSuite, implementing filters on high-volume pages like Desktop Activities requires a deep understanding of performance and the Gosu Query API. When a business requirement involves a " complex query " —typically meaning logic that spans across multiple related entities or involves conditional logic that cannot be expressed in a simple ToolbarFilterOption—the best practice is to encapsulate that logic within a separate Gosu function.
Using a function that utilizes a subselect clause is a preferred architectural pattern for complex filtering. A subselect allows the database engine to perform the filtering logic entirely at the SQL level (e.g., using an EXISTS or IN clause) without pulling large amounts of data into the application server ' s memory. This is significantly more efficient than retrieving a list of objects and then filtering them in Gosu (as suggested in Option A or B). In the context of PCF Configuration, the filter property of a ToolbarFilterOption or a Filter widget can call this function, which returns a Query object.
By returning a Query instead of a list of results, the UI component can further optimize the database call with paging and sorting logic. Option B, which suggests using for loops and if statements, is a direct violation of performance standards as it would result in " N+1 " query problems and excessive memory consumption on the application tier. Therefore, leveraging the power of the Query API with subselects ensures that the application remains responsive even as the volume of activities grows.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit