REA-Hruby – Contract Pattern

Contracts are statements of intent that regulate the behavior among organizations and individuals. Clauses of a good contract define what should happen in the cases of cancellation and violation of the commitments.

Business reality

Commitments represent the optimistic path of an exchange process. For example, a sales order contains commitments to deliver goods and commitments to pay. However, sometimes goods are not delivered as expected and pay­ments arrive late. Partners usually also agree upon what should happen if the initial commitments are unfulfilled.

Problem: How do we specify in the REA model what should happen if the commit­ments are unfulfilled?


  • Commitments specify what economic events should occur. However, in the case in which they do not occur as they should, economic agents usually agree upon what should happen next. The rules specifying what should happen next can be very complex, and keeping track of what should happen, and when, can be cumbersome. Therefore, application developers would like this information present in the business applica­tion, so that these rules and actions can be monitored and triggered automatically.
  • There are usually several inflow commitments paired through exchange reciprocity with several outflow commitments. These commitments are often considered a unit. Sometimes, it does not make sense to fulfill only some commitments and not to fulfill others, but sometimes this is acceptable. Application designers would like some entity to contain such rules.
  • Intended recipients or providers of the resources might be different eco­nomic agents than the agents that agree about the exchange.


If a commitment is unfulfilled, the terms of a contract specify additional commitments.

A Contract is an entity in the REA application model containing incre­ment and decrement commitments that promise an exchange of economic resources between economic agents, and terms. Commitments were dis­cussed in the previous pattern. Terms are potential commitments that are instantiated if certain conditions are met. These conditions can be various, such as a commitment not being fulfilled, or a resource being at a certain location. For example, economic agents can agree upon penalties if the commitments are unfulfilled. If the commitments are unfulfilled, the con­tract will instantiate a new commitment to pay a penalty. The terms and commitments are the clauses of the contract.

Every contract must be related to two or more economic agents by a party relationship. These agents do not necessarily have to be the provider and recipient of economic resources. The economic agents that are parties in a contract can be different from the economic agents related to the commitments within the same contract, and different from the agents par­ticipating in the economic events which fulfill these commitments. For ex­ample, a flower shop can deliver flowers to a different person than the one who placed the order, and the flowers will be paid for by a third person, different from the persons who placed the order and received the flowers.

Contract, commitment and terms

Figure 1. Contract, commitment and terms.

Offer and Quote have the same structure as contracts that have not been accepted by all parties in a contract. Economic agents negotiate the content of the commitments and terms, and when they agree upon commitments and terms, the quote or offer becomes a contract that binds the agents that are parties in the contract. There is usually certain period of negotiations and draft versions from when the offers and quotes are created and until the contracts are accepted by both contracting parties.


Examples of Contracts are service contractsemployment contractssales orders, and purchase orders.

Figure 2 illustrates a business document for a simple sales order without delivery and payment terms.

A sales order is an example of a contract

Figure 2. A sales order is an example of a contract.

Figure 3 illustrates the REA application model for this sales or­der. The Sales Order contains two Sales Lines specifying the goods; the sales line entity corresponds to the line item in Figure 2. The Payment Line specifies the price (i.e. expected amount of re­ceived cash); the entity Payment Line corresponds to the Total line in Figure 2.

The REA application model of a sales order

Figure 3. The REA application model of a sales order.

A more complicated example of a sales order with shipment and payment terms is illustrated in Figure 4. For example, Joe’ Pizzeria and Addy agree that Joe’s Pizzeria will sell five units of Pizza Margherita to Addy on Tuesday, and Addy will pay for them on Friday. If Joe’s Pizzeria does not ship on Tuesday, Joe’s Pizzeria pays a 20 USD penalty to Addy on Friday. If Addy does not pay on Friday, he pays a 30 USD penalty to Joe’s Pizze­ria the following Monday. The informally sketched properties of the terms and commitments can be implemented as DUE DATE PATTERN and VALUE PATTERN (Behavioral Patterns).

Simple contract with shipment and payment terms

Figure 4. Simple contract with shipment and payment terms.


The precise specification of commercial contracts is a subject of intensive research. A lan­guage for REA-compatible contracts is being developed by Fritz Henglein.

There are also higher level agreements between economic agents that regulate the behavior of the individual contracts.

Agreements differ from contracts in that they do not contain commitments, but only conditional clauses, and they are hierarchical in nature. Agreements are sketched in Figure 5.

An example of an agreement is a service level agreement for mainte­nance of equipment, which specifies, for example, that the enterprise may place maintenance orders (i.e. contracts) under specific conditions, and re­ceive discounts for specific services.

Agreement and contract

Figure 5. Agreement and contract.