Order Processing Pipeline Basics

Imagine a situation in which a department within a company is charged with processing a large volume of orders daily. To deal with such volume, the company must break the processing of an order into discrete pieces, perhaps assigning one person the task of calculating shipping on an order, another with making sure the items on the order are in inventory, and another with ensuring that the prices on the order reflect the current price of the item.

In order for such an assembly-line approach to order processing to work, some level of coordination is essential among the people charged with order-related tasks. Thus, while breaking order processing into stages to make large-volume processing possible, this hypothetical processing department must also define the rules by which the people or departments charged with various tasks inter-operate.

The order processing pipeline (OPP) approaches work in much the same way as this order processing department. It addresses the need for compartmentalization by breaking the processing of orders into stages, abstractions that describe a category of work, and by determining the sequence in which each category of work is performed. Thus, a typical OPP may include a Shopper Information stage, a Payment stage, and a Shipping stage.

Each stage in a pipeline consists of zero or more components, and each of these components is run in sequence. A component is a Component Object Model (COM) object that is designed to perform some operation on an OrderForm. In many cases, the scope of this operation is quite small. For example, the DefaultShipping component, which is included in the Shipping stage, makes sure that another component has not already calculated the shipping cost on an order. If this cost has already been set on the OrderForm, the DefaultShipping component overwrites the set value with a zero (0) to ensure that the components that follow in the Shipping stage are starting with a reliable value.

The OPP further coordinates the work of components by ensuring that every component in an OPP is reading from and writing to the same purchase order. This purchase order is the OrderForm object. The OrderForm object, which constitutes the link between the Web site and the OPP, is designed to contain all the information necessary to process a purchase over the Web, including shopper, shipping, tax and item price information. In addition, the OrderForm object supports the methods necessary to add new items to itself. After each component in the OPP performs its work on the OrderForm, the OPP passes the OrderForm to the next component in the pipeline.

As the designer of the pipelines for your site, you also take measures to ensure that the OPP functions correctly. First, you should generally make sure that no pipeline component is configured to overwrite the work done by another component. (The required components, such as the DefaultShipping component previously described, are intentional exceptions to this rule.)

Second, define the circumstances under which the OPP will stop processing an OrderForm. As each component in the OPP executes, it returns a status constant that indicates success, a warning, or failure. If you configure a stage to tolerate warnings, the OPP continues to operate despite a warning generated by that component. If you configure a stage to tolerate only success, and the component returns a warning, then the OPP stops processing the OrderForm, and returns an error.


© 1997-1998 Microsoft Corporation. All rights reserved.