Formula expressions in business rules

In formula expressions, you enter literals, context objects, arithmetic operators, and utility functions directly in the text field. The arithmetic operators are +, -, *, /, and %. For information about these operators, see Arithmetic expressions in Gosu. Utility functions are defined globally and are always available.

When you start typing, autocomplete shows you available objects, properties, and methods based on the selected Rule Context and filtered by the text you enter.

To select from available objects, press Spacebar. Type one or two letters to display first-level objects containing letters in that order. Type a period after the object to select its subobjects, properties, and methods. Type three or more letters to display objects containing letters in that order. The letters can match objects at multiple levels of nesting. The number of levels is defined in the BizRulesLeafSearchNumOfHops parameter in config.xml. The default value is 3.

For example, if you type cont, you can choose objects at three levels such as policyEvalContext, policyPeriod.BillingContact, and policyPeriod.BasedOn.ContainerId.

To access utility functions, type Util followed by a period.

The following formula expressions use literals and comparison operators:

  • 50
  • 50 + 50
  • "some" + "thing"