This content has been marked as final. Show 3 replies
Pipeline chain is a set of modular code execution, where in each module does discrete independent operation and passes the control on to the next module or processor.
So if you talk about commerce pipeline, it consists of a number of processors that do some logic and after successfully completing the logic passes the control to the next processor.
So the request flows through the pipeline via processors defined in it.
One of the most important tasks for an ATG server is handling HTTP requests. The ATG server extends the basic web server model with various Nucleus services that implement the Servlet interface, and which are linked in order to process HTTP requests. Each servlet performs a specialized function on a request, then relays the request—sometimes in modified form—to the next servlet in the chain. While each servlet performs a unique service, it often relies on changes that previous servlets made to the request. This chain of servlets is called a request handling pipeline.
To use ATG platform functionality, a web application needs to start Nucleus by invoking NucleusServlet. This servlet does not need to have any paths mapped to it, but must have the loadon-startup flag set to 1 so that it runs before any other ATG component. The web.xml file in atg_bootstrap.war includes the following lines:
The NucleusServlet creates an instance of Nucleus and sets it as an attribute of the web application.
After invoking NucleusServlet, the web container calls PageFilter filter, which starts execution of the request-handling pipeline for JSP requests by calling the pipeline’s first servlet, */atg/dynamo/servlet/dafpipeline/DynamoHandler* of class atg.servlet.pipeline.HeadPipelineServlet. This servlet generates a DynamoHTTPServletRequest that wraps the generic HTTPServletRequest so pipeline servlets can read information from the request and also modify it. A matching DynamoHTTPServletResponse is also generated. DynamoHandler passes the Dynamo request/response pair to the next servlet in the request handling pipeline.
Its code is like. For example:
Similarly when we call handleSetOrder() method to recalculate then updateOrder pipeline chain executed, which is part of commerce pipeline chains. For more detail you can refer to http://docs.oracle.com/cd/E23095_01/Platform.93/ATGCommProgGuide/html/s1209commerceprocessorchains01.html
Basically pipeline chain is a set of processors, each processor is a servlet class. If any processor gives error then Nucleus will not proceeds other processors in pipeline chain.
When we use CartModifierFormHandler.handleAddItemToOrder() method, then handleAddItemToOrder will call CartModifierFormHandler.addItemToOrder. CartModifierFormHandler.addItemToOrder calls CartModifierFormHandler.doAddItemsToOrder. CartModifierFormHandler.doAddItemsToOrder calls PurchaseProcessHelper.addItemsToOrder. PurchaseProcessHelper.addItemsToOrder calls PurchaseProcessHelper.runProcessAddItemToOrder. PurchaseProcessHelper.runProcessAddItemToOrder calls PurchaseProcessHelper.runProcess. PurchaseProcessHelper.runProcess will finally call PipelineManager.runProcess method and this method call updateOrder pipeline chain.