Gosu rule syntax

Guidewire Gosu rules use a programming language called Gosu, which is a high-level language tailored for expressing Gosu rule logic. The syntax supports rule creation with business terms, while also using common programming methods for ease of use. Gosu syntax can be thought of in terms of both statements and expressions. Before you begin to write rules, Guidewire strongly recommends that you make yourself completely acquainted with the Gosu programming language.

Statements are merely phrases that perform tasks within Studio. Examples of statements include the following:

  • Assignment statements
  • If statements
  • Iteration statements
All expressions use a dot notation to reference fields, subobjects, and methods. For example, to retrieve the latest PolicyPeriod (of possibly several branches), do the following:
  • var period = Job.LatestPeriod

An expression can consist of one or many statements.

Important: Use only Gosu expressions and statements to create PolicyCenter Gosu rules. For example, do not attempt to define a Gosu function in a Gosu rule. Instead, define a Gosu function in a Gosu class or enhancement, then call that function from a Gosu rule. Guidewire expressly does not support the definition of functions—and especially nested functions—in Gosu rules.

See also