Rule language

Business experts write the business rules that drive the decision logic using the rule language. The syntax of the rule language is close to that of the natural language.

A basic rule uses an if-then statement to associate a condition (if) with an action (then). The rule states what decision to make when a condition is true. For example, here is a simple rule that describes the action to take for gold customers, which is to apply a 10% discount:

if
   the category of the customer is gold
then
   print "apply a 10% discount to the shopping cart of this customer";
The language is comprised of a series of statements, or building blocks:
  • Constructs to build the different parts of your rules – the condition part, which is optional, and the action part.
  • Operators and functions to do arithmetic operations, associate or negate conditions, and compare expressions.
  • Literals to declare values as being of a particular type.
  • Punctuation to structure rules, avoid ambiguity, and provide clarity.
Note: Some of the topics in this section use metasymbols to describe the syntax allowed in business rules. The table below lists the usage of each metasymbol:
Usage Metasymbol
Optional ?
Optional group [ ... ]
Repetition (one or more) +
Repetition (zero or more) *
Grouping ( ... )
Ordered choice |