Business rule performance

Executing a business rule often involves making multiple queries to the database. A large number of database queries can affect business rule performance significantly. Guidewire provides the following business rule parameters to use in configuring a caching strategy that improves business rule performance.
Parameter Cache Description Possible values
BulkLoadRuleHeadByIdCacheEnabled Rule Head cache Parameter determines whether PolicyCenter populates the Rule Head cache with a single query to the database or multiple queries.

The Rule Head cache stores the RuleHead IDs for all business rules.

  • true - PolicyCenter uses a single query to populate the Rule Head cache.
  • false - PolicyCenter uses multiple queries to populate the Rule Head cache.
PreloadBizRulesBeansCacheEnabled Rule Entities cache Parameter determines whether PolicyCenter populates the Rule Entities cache with a single query to the database or multiple queries.

The Rule Entities cache stores the entities that comprise the entire rule graph for all rule versions that can possibly execute in the application.

  • true - PolicyCenter uses a single query to preload the Rule Entities cache with business rule entities from the database.
  • false - PolicyCenter uses multiple queries during rule execution to fetch the necessary business rule entities.
Important: Using a single query to bulk load a cache significantly reduces the number of database queries needed during rule execution and the total time needed to run the queries.

Preloading the Rule Head cache at server start

It is possible to preload the Rule Head cache at server start. Guidewire enables this functionality by default in the base configuration by adding the following entry to file preload.txt:

gw.api.bizrules.startup.BizRulesPreloadActions#preloadRulesVersionsCache
To access this file, navigate to the following location in Guidewire Studio.
  • configuration > config > startup

To disable this functionality, either remove or comment out this line of code in the file.

Preloading the Rule Entities cache at server start

It is possible to preload the Rule Entities cache during server start. However, Guidewire disables this functionality by default in the base configuration. To enable this process, add the following method invocation to file preload.txt:

gw.api.bizrules.startup.BizRulesPreloadActions#preloadRulesBeansDataIntoCache
To access this file, navigate to the following location in Studio.
  • configuration > config > startup