The DEAT Business Rule Pattern Language

Russell R. Hurlbut, Ph.D.

Previous | Table of Contents | Next

Rule Pattern 7: Ordering

Problem – Establishing the Relative Sequence of Elements

The course of action taken in a business process is often determined by the order in which items are considered. For example, eligibility for employee benefits that are based on years of service must consider employment events that are ordered chronologically. This ordering permits a distinction between periods where service is credited and not credited. Several ordering sequences may also apply to the same collection of items. If a proposed new product relied on a customer opinion poll to assist in determining features to include, then each evaluated aspect could provide a ranking. Various weighted ranking that combined all of the aspects could also be generated. Therefore, correct handling requires that items conform to some ordering scheme that evaluates a relative property of one member to others.

Solution

The relative sequence of elements may be established through definition of a sort key and a functional restriction. A sort key requires the identification of an ordered set of attributes, a definition of an inequality function, and a direction. The set of attributes may be a combination of actual and derived attributes. The inequality function will typically be a binary comparison operation that established that one item is less than, or precedes, another item. Direction allows the ordering to be reversed, thus can be represented as a Boolean parameter, such as isAscendingOrder.

A functional restriction identifies a subset of the ordered elements when evaluating if a certain condition exists. The subset is identifies through an element count and direction, such as the preceding three elements or the adjacent two elements in both directions. The condition expression may be based on a binary evaluation that compares the current element against each of the other elements. Optionally, a meta-attribute comparison may be made by applying the Aggregation business rule pattern to a single element by considering the other elements as a whole through the aggregate attribute defined in that pattern.

Example – Emergency Contact

An organization identifies a person on call for handling reported problems with its database servers. Two additional backup persons are also required to be available on call. This example also includes routing through application of a Role business rule pattern by naming roles for the ordering rather than individuals.

Emergency Contact Parameters and Case Values

Parameters:

Sort Key

call order

IsAscending

<default:true>

Case:

CallOrder

Contact

1

[database server primary contact person]

2

[database server first backup person]

3

[database server second backup person]


Example – Test Scores

A training program allows employees to proceed to the next instruction unit only if their last score is over 85 and they have shown improvement over two of the three preceding quizzes after completing the current unit. In this example, the last quiz fail to exceed two of the previous three scores, so an additional quiz must be taken, along with any other exercises mandated prior to taking the quiz. The next quiz will require a minimum score of 87.

Test Scores Parameters and Case Values

Parameters:

Sort Key

chronological date of quiz

IsAscending

<default:true>

Functional restriction

Scope

3

Direction

preceding

Count

2

Condition

current.score > [element].score

Case:

Quiz date

Test scores

12-Feb-1998

85

13-Feb-1998

90

16-Feb-1998

86

17-Feb-1998

86


UML Representation and Related Patterns

The Ordering model element contains an optional FurnctionalRestriction that constrains Elements that belong to a collection.

The Ordering business rule pattern may collaborate with the Role business rule pattern by naming roles for the ordering rather than individuals.

UML Representation of Ordering Pattern

 

Previous | Table of Contents | Next

 

 

 Copyright 1998 Expertech.Ltd. All Rights Reserved.
 Legal