Sentences supports the declarative definition of business rules. Every entity and association type may have a number of state domains, and each domain contains many states:

Associated with each state domain is a predicate query, which checks to see what state the instance is in:



Business rules may then be defined. There are two types: state rules and change rules. Both depend on the concept of a change: a change occurs when an instance moves from one state to another.

  • A state rule prohibits a certain change, either unconditionally or under certain conditions.

  • A change rule say that when a certain change occurs, one or more other changes must also occur, either unconditionally or under certain conditions.

Both state and change rules are automatically enforced by the database.

This example shows some rules that control how sales orders may progress through their states:

 

 
           
 
 
  Copyright © 2011 - 2015 Lazysoft Ltd.  All Rights Reserved.