There are two ways to extend a pipeline defined for a PipelineManager
. One is to copy the entire XML file into your CONFIG layer and make the necessary changes. The other way is to use XML combination. Using XML combination is the preferred approach. The example below demonstrates of how to use XML combination to modify a pipeline chain.
The XML below is a section of the processOrder
pipeline chain as it appears out of the box.
<pipelinechain name="processOrder" transaction="TX_REQUIRED" headlink="executeValidateForCheckoutChain"> <pipelinelink name="executeValidateForCheckoutChain" transaction="TX_MANDATORY"> <processor jndi="/atg/commerce/order/processor/ExecuteValidateForCheckoutChain"/> <transition returnvalue="1" link="checkForExpiredPromotions"/> </pipelinelink> <pipelinelink name="checkForExpiredPromotions" transaction="TX_MANDATORY"> <processor jndi="/atg/commerce/order/processor/CheckForExpiredPromotions"/> <transition returnvalue="1" link="removeEmptyShippingGroups"/> </pipelinelink>
The following example demonstrates how to add a new processor called purgeExcessOrderData
between the executeValidateForCheckoutChain
and checkForExpiredPromotions
processors in the processOrder
pipeline chain. The following XML code should be added to your config
layer.
The important sections of this code are the additions of the xml-combine
attributes in the pipelinechain
and pipelinelink
tags. The pipelinechain
tag indicates what is being appended to its contents. The pipelinelink
tag for executeValidateForCheckoutChain
indicates what is replacing its contents.
<pipelinemanager> <pipelinechain name="processOrder" transaction="TX_REQUIRED" headlink="executeValidateForCheckoutChain" xml-combine="append"> <pipelinelink name="executeValidateForCheckoutChain" transaction="TX_MANDATORY" xml-combine="replace"> <processor jndi="/atg/commerce/order/processor/ExecuteValidateForCheckoutChain"/> <transition returnvalue="1" link="purgeExcessOrderData"/> </pipelinelink> <pipelinelink name="purgeExcessOrderData" transaction="TX_MANDATORY"> <processor jndi="/atg/commerce/order/processor/PurgeExcessOrderData"/> <transition returnvalue="1" link="checkForExpiredPromotions"/> </pipelinelink> </pipelinechain> </pipelinemanager>
The purgeExcessOrderData
processor’s transition is what the executeValidateForCheckoutChain's
transition is in the base file within the commerce platform.