Discovering business rules involves two things—identifying what terms need to be included in the Vocabulary and identifying the business rules themselves. Let’s start with the Vocabulary.

Identify Vocabulary terms and associations

To get started, we review the business problem and start compiling terms that need to be included in the Vocabulary. Based on this, we can identify the key entities and the assumptions we can make about each entity:

  • Customers:
    • A Customer has a Name.
    • A Customer uses a Shopping Cart to carry items.
    • A Customer may be a Preferred Shopper and have a Preferred Shopper account that is identified by swiping their Preferred Card at checkout.
    • A Preferred Shopper account has a Card Number.
    • A Preferred Shopper account holds a Cash-Back Balance.
    • One Preferred Shopper account may be used by anyone in a family.
  • Items being purchased:
    • An Item has a Name.
    • An Item has a Price.
    • An Item has a Bar-coded label.
    • An Item has a Department embedded in the Bar-coded label.
  • Shopping Carts:
    • A Shopping Cart contains the Items a Customer purchases during each visit.
    • A Shopping Cart has a Total Amount.
    • If the Customer has a Preferred Shopper account, a Cash-Back Bonus is calculated using the Shopping Cart’s Total Amount and is deducted from the Total Amount upon a Customer request.
  • Coupons:
    • Coupons are issued to shoppers based on promotions.
    • A Coupon has a Description.
    • A Coupon has an Issue Date.
    • A Coupon has an Expiration Date.

Based on these assumptions, we can derive the attributes for each entity in our Vocabulary. Attributes are properties or characteristics that distinguish one instance of an entity from another. For example, each Item has attributes like name, a price, and bar code. The attribute values for each item make it unique.

This table lists the attributes for each entity along with their data type and attribute mode:

The mode of an attribute can be Base or Transient. Attributes that have a Base mode are attributes whose values will be sent to the rule model from a client application and/or returned to a client application from the rule model. Transient attributes are only used within the rule model. Their values are assigned or derived by rules, but not sent to a client application. For example, the cashBackEarned attribute is a Transient attribute that is used to update the value of the cumulativeCashBack attribute, which is a Base attribute.

Next, let’s identify the associations for our Vocabulary. An association defines the relationship between two entities. An association can be one-to-one, one-to-many, many-to-one, or many-to-many. In our grocery store business problem, we have the following associations:

  • Many Customers (members of a family) can be associated with one PreferredAccount (many-to-one).
  • One Customer can be associated with many ShoppingCarts over multiple visits (one-to-many).
  • One ShoppingCart can be associated with many Items (one-to-many).

To make these relationships clear, we create a diagram of the associations. Creating a diagram is especially useful when you have a large or complex Vocabulary with many associations. Here is the diagram of entities and associations for our business problem:

In our diagram, the connectors between entities show the kind of relationship. For example, Customer has a one-to-many association with ShoppingCart.

Identify the business rules

Next, let’s identify specific business rules. At a high level, this is the basic process followed by every customer making purchases at a store:

While there may be several steps involved in this process, we as rule modelers are most concerned with those steps where decisions are made. In this case, the Checkout step contains the rule-based decisions that are built into the store’s cash registers.

Let’s drill down into the Checkout step and define more detail about the rules inside. If a natural sequence or “flow” of logical substeps can be identified within a single decision step, it often makes sense to organize the substeps using separate Rulesheets, and then combining them into a Ruleflow. For the Checkout step, we identify three substeps as shown below. We will create a Rulesheet for each of these substeps and combine them into a Ruleflow.

Next, let’s look at the business rules that we need to model for each substep: