About Order Processing Pipelines

Imagine a company department charged with processing a large volume of daily orders. To deal with the volume, the department might divide order processing into a series of steps, assigning one person to calculate shipping, another with ensuring the items ordered are in inventory, and another with checking prices.

For such an assembly-line approach to work, some level of coordination is essential among the people charged with order-related tasks. Thus, while dividing order processing into stages to make large-volume processing possible, this hypothetical processing department must also define the rules that coordinate the various tasks.

The Order Processing pipelines (OPP) work in much the same way as this hypothetical department. The Order Processing pipelines divide order processing into stages that describe a category of work. 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. The components are run in sequence. A component is a Component Object Model (COM) object designed to perform some operation on an OrderForm object or other Dictionary object. In many cases, this operation is small. For example, the DefaultShipping component, which runs in the Shipping stage, ensures that another component has not already calculated the shipping cost. If this cost has already been set, the DefaultShipping component overwrites the value with zero (0) to ensure that components later in the Shipping stage begin 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 is the link between the Web site and the pipeline, contains all the necessary information to process a purchase, including user, shipping, tax, and item price information. In addition, the OrderForm object supports the methods needed to add new items to itself. After each component in the OPP performs its work on the OrderForm object, the OPP passes the OrderForm object to the next component in the pipeline.

The designer of the pipelines for your site needs to take measures to ensure that the OPP functions correctly. First, configure pipeline components so that they do not overwrite the work done by another component. (Components such as the DefaultShipping component are exceptions to this rule.) Second, define the conditions under which the OPP will stop processing an OrderForm object. As each component executes, it returns a status value indicating success, a warning, or failure. If you configure a stage to tolerate warnings, the OPP continues to operate despite warnings. If you configure a stage to tolerate only success, and the component returns a warning, then the OPP stops processing the OrderForm object, and returns an error.


All rights reserved.