| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.process.action.ActionImpl
atg.commerce.promotion.AddItemToOrder
public class AddItemToOrder
This action takes is responsible for creating a CommerceItem object from the passed product, sku, and quantity parameters and adding it to the first order that is in a state of INCOMPLETE.
| Field Summary | |
|---|---|
| static java.lang.String | CLASS_VERSIONClass version string | 
| protected  ComponentName | mOrderHolderComponentorder holder component name | 
| protected  OrderManager | mOrderManagerreference to the order manager object | 
| protected  java.lang.String | mPricingOperationrepricing operation to use | 
| protected  PricingTools | mPricingToolsreference to the pricing tools | 
| protected  PromotionTools | mPromotionToolsreference to the PromotionTools | 
|  java.lang.String | PRICING_TOOLS_PATHLocation of the PricingTools component. | 
| static java.lang.String | PRODUCT_PARAMParameter for product id information | 
|  java.lang.String | PROMOTION_TOOLS_PATHLocation of the PromotionTools component. | 
| static java.lang.String | QUANTITY_PARAMParameter for quantity information | 
|  java.lang.String | SHOPPINGCART_PATHLocation of the OrderHolder component, called the shopping cart. | 
| static java.lang.String | SITE_ID_PARAMParameter for site id | 
| static java.lang.String | SKU_PARAMParameter for sku id information | 
| Constructor Summary | |
|---|---|
| AddItemToOrder() | |
| Method Summary | |
|---|---|
| protected  void | addItem(java.lang.String pSkuId,
        java.lang.String pProductId,
        long pQuantity,
        java.lang.String pSiteId,
        ProcessExecutionContext pContext)This method will actually perform the action of adding an item to an order. | 
|  void | configure(java.lang.Object pConfiguration)Configures the action using the given configuration object. | 
| protected  void | executeAction(ProcessExecutionContext pContext)Executes this action in the given single process execution context. | 
|  Order | getOrderToAddItemTo(ProcessExecutionContext pContext)This method returns the order to which the CommerceItem should be added. | 
|  void | initialize(java.util.Map pParameters)Initializes the action with the given parameters. | 
| Methods inherited from class atg.process.action.ActionImpl | 
|---|
| execute, execute, getActionName, getParameterExpression, getParameterValue, storeOptionalParameter, storeRequiredMutableParameter, storeRequiredParameter, toString, toString | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static java.lang.String CLASS_VERSION
public java.lang.String SHOPPINGCART_PATH
public java.lang.String PROMOTION_TOOLS_PATH
public java.lang.String PRICING_TOOLS_PATH
public static final java.lang.String PRODUCT_PARAM
public static final java.lang.String SKU_PARAM
public static final java.lang.String QUANTITY_PARAM
public static final java.lang.String SITE_ID_PARAM
protected OrderManager mOrderManager
protected PromotionTools mPromotionTools
protected PricingTools mPricingTools
protected ComponentName mOrderHolderComponent
protected java.lang.String mPricingOperation
| Constructor Detail | 
|---|
public AddItemToOrder()
| Method Detail | 
|---|
public void configure(java.lang.Object pConfiguration)
               throws ProcessException
configure in interface Actionconfigure in class ActionImplProcessException - if the action could not be configured
 - for example, because some of the required properties are
 missing from the configuration
public void initialize(java.util.Map pParameters)
                throws ProcessException
ActionImplThis default implementation does nothing.
initialize in interface Actioninitialize in class ActionImplProcessException - if the action could not be properly
 initialized - for example, if not all of the required parameters
 are present in the MapExpression
protected void executeAction(ProcessExecutionContext pContext)
                      throws ProcessException
ActionImplexecute methods.
executeAction in class ActionImplProcessException - if the action can not be executed
public Order getOrderToAddItemTo(ProcessExecutionContext pContext)
                          throws CommerceException,
                                 RepositoryException
pContext - - the process execution context at the time of this event
CommerceException
RepositoryException
protected void addItem(java.lang.String pSkuId,
                       java.lang.String pProductId,
                       long pQuantity,
                       java.lang.String pSiteId,
                       ProcessExecutionContext pContext)
                throws CommerceException,
                       RepositoryException
pSkuId - the sku id of the commerce item that will be created and added to the orderpProductId - product id of the commerce item that will be created and addedpQuantity - the quantity of the particular item to addpContext - the context in which the action is occuringpSiteId - the id of site order will be associated with
CommerceException - if an error occurs
RepositoryException - if an error occurs| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||