The Business Rule Vocabularies
Business rule vocabularies are user-defined names for the facts that you use in rule conditions and actions. Vocabulary definitions make rules easier to read, understand, and share among various workers within a particular business domain. For example, the source location for a particular fact is a specific field in one record in a single database and is represented as an SQL query. Instead of using the SQL query in the rule, you can use a vocabulary definition to assign a meaningful name with the query for the benefit of all the relevant parties in the development and deployment process for the rule.
Consider the following example of a business rule:
If the Shopping Cart contains more than $1,000 worth of items, give the customer a 10% discount.
This rule is easy to understand. It is a Boolean comparison (greater than) between two variables, the shopping cart and a value of 1,000. The action to be performed is to apply a 10 percent discount to the total order. In computer terms, this rule will look like this:
If Company.Namespace.ShoppingCart.PurchaseAmount > Qualifying Amount as System.Decimal
Then
Company.Namespace.Customer.DiscountedAmount = Company.Namespace.ShoppingCart .PurchaseAmount * .1
To provide a more user-friendly alias, you can create a business rule vocabulary to abstract difficult concepts by defining an alias to the schema nodes, database fields, and .NET classes. Vocabularies make the creation and maintenance of these rules much easier. Correctly defined vocabularies can empower information workers in maintaining policies.
The Business Rule Composer contains two built-in vocabularies, Predicates and Functions, which are used in the creation of all rules. You can extend these vocabularies if required. For example, the phrase “If the Shopping Cart contains more than $ 1,000 worth of items” is actually a greater than comparison (Shopping Cart > 1,000). You can define an additional vocabulary term to clarify the meaning of the relationship represented by the built-in Greater Than function.