Rule members

As described previously, a rule consists of a set of conditions and actions to perform if all the conditions evaluate to true. It typically references the important business entities and objects (policies, for example).

Rule conditions

Rule conditions are a collection of expressions that provide true/false analysis of an entity. If the condition evaluates to true, then Studio runs the activities in the ACTION block. For example, you can use the following condition to test whether the contact information includes a home phone number:
  • contact.HomePhone == null

Rule actions

Rule actions are a collection of action expressions that perform business activities such as making an assignment or marking a field as invalid. These actions occur only if the corresponding condition in the CONDITION block evaluates to true. For example, if a contact information is missing a home phone number, you can use the following code to raise an error in PolicyCenter:
contact.rejectField("HomePhoneCountry", ValidationLevel.TC_LOADSAVE,
      displaykey.Validator.Phone.Home.CountryCode.Null, null, null)

Rule APIs

Rule APIs are a collection of Gosu methods accessed through the gw.api.* package. They include many standard mathematic, date, string, and financial methods. For example, you can use the following code to determine if an activity (act) is more than 15 days old and thus needs additional handling:
gw.api.util.DateUtil.differenceInDays(act.CreateTime, 
      gw.api.util.DateUtil.currentDate()) > 15

Rule entities

Rule entities are the collection of business object entities that PolicyCenter supports. Guidewire Studio objects use the familiar “dot” notation to reference fields and objects.

For example, you can use the following object condition to automatically raise evaluation issues for the specified location:
  • PolicyPeriod.autoRaiseLocationEvalIssues(location)