Rule contexts and rule context definitions
A rule context and a rule context definition are not identical business rule constructs. It is important that you understand the difference between the two concepts.
| Rule | Description |
|---|---|
| Context definition |
PolicyCenter uses the rule context definition to define the symbol table that provides the list of symbols available in the business rules editor while creating or editing a rule during rule development. |
| Context |
PolicyCenter uses the rule context as a runtime construct to populate the context definition symbols with actual data from the rule that triggered the current action. It then uses this symbol data during execution of the triggered rule. |
PolicyCenter business rule context definition
Guidewire defines rule contexts in the following business rules package:
gw.bizrules.provisioning.contexts
This package contains context definition classes such as the following, plus many more:
- BusinessOwnersUWContextDefinition
- CommercialPropertyUWContextDefinition
- GenericUWRuleContextDefinition
A rule context definition can contain one or more context symbols. For
example, Gosu class
CommercialPropertyUWContextDefinition
contains the following addSymbol definitions in the
class constructor:
construct() {
addSymbol(PARAM_CPLINE, CommercialPropertyLine, \ec -> ec.Period.CPLine)
addSymbol(PARAM_CPLOCATIONS, CPLocation[], \ec -> ec.Period.CPLine.CPLocations)
addSymbol(PARAM_CPBUILDINGS, CPBuilding[], \ec -> ec.Period.CPLine.CPLocations.arrays("Buildings")
.toArray(new CPBuilding[0]))
}
