Vous êtes sur la page 1sur 1

How to customize an ATG pipeline

Page 1 of 1

OUROWNJAVA.COM
Core Java

ATG

Endeca

Search this site...

Solr

Spring

JBoss

TDD

MongoDB

UML

Certification

Other

Your email Address...

Subscribe

INTERCEPT AN ATG PIPELINE.


ATG pipeline allows developers to write modular code and inject the same in an execution path based on the
result from another processor in pipeline chain. Nucleus component /atg/commerce/PipelineManager implement
the commerce pipeline loading, execution and reloading logic. Commerce pipeline is defined in an xml file located
in /B2CCommerce/config/atg/commerce/commercepipeline.xml.

TOP POSTS & PAGES


User registration page in ATG using DSPs

What is a pipeline?

and Handler.

Pipeline is a collection of processors which executes sequentially. You can decide the branch to execute based

Intercept an ATG pipeline.


How to reload property file in java at runtime?

on a return value from a processor.

ATG Targeting Servlets/Droplets.


ATG Droplet Static Design.
ATG Composite Repository.
Oracle Endeca Commerce Overview
How to get Java thread dump in Linux?
How to create file lock in java?
In the above given example, processor two is executed if the return value from processor one is two.

BESTSELLERS

ATG pipeline framework static design

Nokia Lumia 520


List Price Rs.8999

Our Price Rs.8054

Buy Now

The Online Megastore

Initialize the commerce pipeline chain


ourownjava.com

PipeLine manager is responsible load the pipeline definition xml and initialize the pipeline chains. Below given

Like

sequence diagram will help you to understand the flow of execution.


38 people like ourownjava.com.

Facebook social plugin

ourownjava.com @ourownjava

ourownjava 2 tweeps followed (thank you!)


and 2 unfollowed (goodbye!) me in the past
week. Thank you http://t.co/QDRVg2861E.
Dec 31 reply retweet favorite

Calling commerce pipeline from a form handlers

website designers

Steps to inject a processor link to commerce pipeline


1.Write your processor class. Custom Processor class should be an implementation of PipelineProcessor.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

package com.ourownjava.atg.pipeline;
/**
* @author ourownjava.com
*/
import atg.nucleus.logging.ApplicationLoggingImpl;
import atg.service.pipeline.PipelineProcessor;
public class ProcCheckInventory extends ApplicationLoggingImpl implements
PipelineProcessor {
public int[] getRetCodes() {
return new int{1,2};
}
public int runProcess(final Object pParam, final PipelineResult pResult)
throws Exception {
// check inventory and return the status accordingly
return 1;
}
}

2.Identify the correct location to inject the new processor class in pipeline chain.
In this example we will inject new processor class as the second processor in the updateOrder chain.

3.Register the new processor class as a nucleus component.


1
2
3
4

#ProcCheckInventory.properties
#/info/atgblog/inventory/processor/ProcCheckInventory
$class=/info/atgblog/inventory/processor/ProcCheckInventory
$scope=glboal

4.Update the B2CCommerce/config/atg/commerce/commercepipeline.xml to add new processor class.


1 <pipelinechain name="updateOrder" transaction="TX_REQUIRED" headlink="updateOrderObject">
2
<pipelinelink name="updateOrderObject" transaction="TX_MANDATORY">
3
<processor jndi="/atg/commerce/order/processor/SaveOrderObject"/>
4
<transition returnvalue="1" link="checkInventoryObject"/>
5
</pipelinelink>
6
<pipelinelink name="checkInventoryObject" transaction="TX_MANDATORY">
7
<processor jndi="/info/atgblog/inventory/processor/ProcCheckInventory"/>
8
<transition returnvalue="1" link="updateCommerceItemObjects"/>
9
</pipelinelink>
10
<pipelinelink name="updateCommerceItemObjects" transaction="TX_MANDATORY">
11
<processor jndi="/atg/commerce/order/processor/SaveCommerceItemObjects"/>
12
<transition returnvalue="1" link="updateShippingGroupObjects"/>
13
</pipelinelink>
14 ...........
15 </pipelinechain>

5.Restart your ATG application server. You are done. You have added pipeline link in the commerce pipeline.
Alternatively commerce pipeline can be edited using acc pipeline editor.

Related Posts
ATG Targeting Servlets/Droplets.
User registration page in ATG using DSPs and Handler.
ATG Generic Session Manager/Session Tracking.
ATG Composite Repository.
ATG Droplet Static Design.
Like this:
Be the first to like this.

Tags: ATG Pipeline, ATG Pipeline Customization, Customize ATG pipeline, intercept an ATG pipeline

LEAVE A REPLY

CATEGORIES
ATG

CONTACT

Certification

Core Java

CONNECT

Looking for tutorial on a specific topic? Do let


us know. We will write that for you. Please

Eclipse

Endeca

Maven

MongoDB

Solr

Spring

Validation

JBoss

TDD

send your feedback to info@ourownjava.com

Other
UML

Version Control

Windows

ourownjava.com Copyright 2014.

http://ourownjava.com/atg/intercept-an-atg-pipeline/

by Sanju Thomas

Back to Top

1/9/2014

Vous aimerez peut-être aussi