Component Coordination

Because Commerce Server 2002 pipeline components run in a linear fashion, certain coordination must exist between the components. Component coordination is critical when multiple components exist within the same stage but only some of the components in the stage are implemented. The components that are implemented correlate to the actions of the Web site user. For example, the Payment stage might include one component that implements payment by electronic currency, and another that charges to a credit card. But you only want to run the component that corresponds to the request made by the user. If the user would like to pay by credit card, the payment by electronic currency component should not be run.

The Commerce Server pipeline architecture dictates that components in certain stages must coordinate to allow such multiple-choice components to exist in the same stage. The components that come with Commerce Server 2002 already follow this convention, and special care must be taken when writing your own components to ensure that they follow this convention.

Keep the following in mind when you create new components:

  • If the value that the component is supposed to compute is already set when the pipeline component begins running, the component should immediately exit. For example, if the user chooses to pay by credit card and the credit card component is run before the electronic currency component, then the credit card component will set the payment_method key to credit card. Then, when the electronic currency component is run, it should see that the payment_method key has been set and should exit.
  • If a component determines that it cannot or should not perform the task for the stage, it should leave the dictionary entry for the stage alone. The payment_method key is a commonly used apply dictionary key in the Payment stage and the component should only continue to run if the proper payment_method key value is set. For example, the user chose to pay by credit card and the credit card component set the payment_method key to credit_card. Then, when the electronic currency component is run it checks to see if the payment_method key is set to electronic currency, and when it determines that the payment method key is not set to electronic currency, it should not apply the rest of the component by charging the user via electronic currency.

Component coordination is critical in the following stages:

  • Shipping. Component coordination is critical for backward compatible components, but usually is not necessary when using the new multiple-shipping shipment architecture in Commerce Server. The _cy_shipping_total key must be coordinated. The shipping_method key is the apply key.
  • Handling. The _cy_handling_total key must be coordinated. The shipping_method key is the apply key.
  • Tax. Although this stage should be coordinated, it is recommended that you have only one tax component in your pipeline. Having only one tax key makes Commerce Server Business Desk management easier. The _cy_tax_total is the key to coordinate. The country key is the apply key.
  • Payment. The payment_method key is the key to coordinate and the apply key.

For information about building pipeline components, see Building Pipeline Components.

Copyright © 2005 Microsoft Corporation.
All rights reserved.