Commerce Server 3.0 provides three similar objects that execute pipeline configurations. These objects differ in the way in which they are registered with MTS.
Object | Description |
---|---|
MtsTxPipeline | Pipeline registered under MTS as transactions required. Holds a transaction across all components in the pipeline configuration. |
MtsPipeline | Pipeline with the same methods as the MtsPipeline object, but registered under MTS as transactions not supported. Commerce Server 3.0 sites should use this pipeline in situations where transactions are not desired. |
OrderPipeline | Pipeline not registered under MTS. It is included for backward compatibility with sites created in Commerce Server 2.0. |
The pipeline is a container for the pipeline components. The pipeline components are specified by a pipeline configuration, which is stored in the pipeline configuration (.pcf) file and configured using the Pipeline Editor.
A pipeline configuration can be designated to require that the configuration is run within a specific type of pipeline. The configuration may be designated for transaction compatibility in one of these ways:
This designation in the .pcf file ensures that the configuration is run in the correct type of pipeline. This is particularly important when the components are marked as requires a transaction. If such components were to be loaded in a non-transacted pipeline, each component would run under its own independent transaction, so that a failure in one component would not roll back the actions of the other components. By using the Pipeline Editor to designate the configuration file as requiring a transacted pipeline, any attempt to execute this configuration file in a non-transacted pipeline is trapped as an error as soon as the configuration is loaded into a pipeline. (The LoadPipe method checks that the designation required by the configuration matches the pipeline. If the configuration does not match, the load fails.)
To create a pipeline object, use the Server.CreateObject method, specifying Commerce.MtsPipeline¸ Commerce.MtsTxPipeline, or Commerce.OrderPipeline as the object’s programmatic identifier.
The following example (from Clocktower’s Basket.asp file) creates an MtsPipeline object ("mscsMtsPipeline
"), loads a pipeline configuration file (Plan.pcf), and executes the pipeline components without using transactions. The pipeline components process the order through the Plan
stages of the pipeline:
REM -- Create the Order Process Pipeline
Set mscsMtsPipeline = Server.CreateObject("Commerce.MtsPipeline")
Call mscsMtsPipeline.LoadPipe(Server.MapPath("\Clocktower") + "\config\plan.pcf")
errorLevel = mscsMtsPipeline.OrderExecute(1, mscsOrderForm, mscsPipeContext, 0)
The MtsPipeline object is usually created on each page in which it is used. The MtsTxPipeline object must be created on the page in which it is used because transactions cannot span multiple pages.
In Commerce Server 2.0 sites, the OrderPipeline object is usually created in Global.asa.