public class AddItemToOrder extends ActionImpl
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected ComponentName |
mOrderHolderComponent
order holder component name
|
protected OrderManager |
mOrderManager
reference to the order manager object
|
protected java.lang.String |
mPricingOperation
repricing operation to use
|
protected PricingTools |
mPricingTools
reference to the pricing tools
|
protected PromotionTools |
mPromotionTools
reference to the PromotionTools
|
java.lang.String |
PRICING_TOOLS_PATH
Location of the PricingTools component.
|
static java.lang.String |
PRODUCT_PARAM
Parameter for product id information
|
java.lang.String |
PROMOTION_TOOLS_PATH
Location of the PromotionTools component.
|
static java.lang.String |
QUANTITY_PARAM
Parameter for quantity information
|
java.lang.String |
SHOPPINGCART_PATH
Location of the OrderHolder component, called the shopping cart.
|
static java.lang.String |
SITE_ID_PARAM
Parameter for site id
|
static java.lang.String |
SKU_PARAM
Parameter for sku id information
|
Constructor and Description |
---|
AddItemToOrder() |
Modifier and Type | Method and Description |
---|---|
protected void |
addItem(java.lang.String pSkuId,
java.lang.String pProductId,
long pQuantity,
double pQuantityWithFraction,
java.lang.String pSiteId,
ProcessExecutionContext pContext)
This method will actually perform the action of adding an item to an order.
|
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.
|
execute, execute, getActionName, getParameterExpression, getParameterValue, storeOptionalParameter, storeRequiredMutableParameter, storeRequiredParameter, toString, toString
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
public void configure(java.lang.Object pConfiguration) throws ProcessException
configure
in interface Action
configure
in class ActionImpl
ProcessException
- if the action could not be configured
- for example, because some of the required properties are
missing from the configurationpublic void initialize(java.util.Map pParameters) throws ProcessException
ActionImpl
This default implementation does nothing.
initialize
in interface Action
initialize
in class ActionImpl
ProcessException
- 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
ActionImpl
execute
methods.executeAction
in class ActionImpl
ProcessException
- if the action can not be executedpublic Order getOrderToAddItemTo(ProcessExecutionContext pContext) throws CommerceException, RepositoryException
pContext
- - the process execution context at the time of this eventCommerceException
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 withCommerceException
- if an error occursRepositoryException
- if an error occursprotected void addItem(java.lang.String pSkuId, java.lang.String pProductId, long pQuantity, double pQuantityWithFraction, 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 addpQuantityWithFraction
- the quantity of the particular item to addpContext
- the context in which the action is occuringpSiteId
- the id of site order will be associated withCommerceException
- if an error occursRepositoryException
- if an error occurs