Wednesday, October 31, 2012

Setting up Price List Functionality in ATG Consumer Commerce





ATG Consumer Commerce users do not have a price list functionality available by default. To add price list functionality, you should:

1.Add the following code to /atg/userprofiling/userProfile.xml in your localconfig:


<gsa-template>
  <header>
    <name>Commerce Related Profile Changes</name>
    <author>DCS Team</author>
     <version>$Id: userProfile.xml,v 1.1 2012/04/26 </version>
   </header>

  <item-descriptor name="user" default="true"
      sub-type-property="userType">
    <table name="dcs_user" type="auxiliary" id-column-name="user_id">
      <property category-resource="categoryCommerceContract"
         name="priceList"
         item-type="priceList"
         display-name-resource="priceList"
         column-name="price_list"
         repository="/atg/commerce/pricing/priceLists/PriceLists"/>
     </table>
   </item-descriptor>
 </gsa-template>


2.Add a price_list column to dcs_user table.

3.Configure the ItemPricingEngine to use the appropriate precalculator. There are price list-specific versions of each of the precalculators used by the ItemPricingEngine. ItemPriceListCalculator is the precalculator for list pricing. ConfigurableItemPriceListCalculator is the precalculator for configurable item pricing.

The following code example shows how the /atg/commerce/pricing/ItemPricingEngine.properties file should change to use the priceList calculators


preCalculators=\
        calculators/ItemPriceListCalculator,\
        calculators/ConfigurableItemPriceListCalculator


Note: The configurable item calculator is optional. It only needs to be used if your site supports configurable commerce items.

Saturday, October 13, 2012

Important Pipeline Chains To Remember :ATG


moveToConfirmation Pipeline Chain


The moveToConfirmation pipeline chain prices the Order and validates it. The moveToConfirmation pipeline chain is executed by the handleMoveToConfirmation() method in the PaymentGroupFormHandler. The pipeline chain’s transaction mode is TX_REQUIRED.


The following list describes each processor in the pipeline chain:


1.PipelineLink Name: executeRepriceOrderChain
This processor causes the repriceOrder pipeline chain to be executed.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ExecuteRepriceOrderChain
PipelineProcessor object: atg.commerce.pricing.processor.ProcExecuteChain
Transitions: return value of 1 will execute executeValidateForCheckoutChain2 next

2.PipelineLink Name: executeValidateForCheckoutChain2
This processor causes the validateForCheckout chain to be executed.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ExecuteValidateForCheckoutChain
PipelineProcessor object: atg.commerce.pricing.processor.ProcExecuteChain
Transitions: None, this is the only link in the chain and will cause the PipelineManager to return to the caller.



moveToPurchaseInfo Pipeline Chain



The moveToPurchaseInfo pipeline chain validates the Order. The moveToPurchaseInfo pipeline chain is executed by the handleMoveToPurchaseInfo() method in the CartModifierFormHandler. The pipeline chain’s transaction mode is TX_REQUIRED.

The moveToPurchaseInfo pipeline chain contains the following processor:


PipelineLink Name: validateOrderForCheckout2
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ValidateOrderForCheckout
PipelineProcessor object: atg.commerce.pricing.processor.ProcExecuteChain
Transitions: None, this is the only link in the chain and will cause the PipelineManager to return to the caller.
Notes: This processor causes the validateForCheckout chain to be executed.



validateShippingInfo Pipeline Chain


The validateShippingInfo pipeline chain validates the ShippingGroups in the Order. The validateShippingInfo pipeline chain is executed by the validateShippingGroupsChainId() method in the ShippingGroupFormHandler. The pipeline chain’s transaction mode is TX_REQUIRED.

The validateShippingInfo pipeline chain contains the following processor:


1.PipelineLink Name: validateShippingGroupsInfo
This processor validates ShippingGroups before checking an Order out. The two main things which are checked for are that all CommerceItems in the Order are assigned to ShippingGroups and that all the required fields in all the ShippingGroups, regardless of type, are not null or empty String.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ValidateShippingGroupsForCheckout
PipelineProcessor object: atg.commerce.pricing.processor.ProcValidateShippingGroupsForCheckout
Transitions: None, this is the only link in the chain and will cause the PipelineManager to return to the caller.



sendScenarioEvent Pipeline Chain


The sendScenarioEvent pipeline chain sends a message to the Dynamo Message System. The sendScenarioEvent pipeline chain is used in various areas of ATG Commerce. The pipeline chain’s transaction mode is TX_REQUIRED.

The sendScenarioEvent pipeline chain contains the following processor:


1.PipelineLink Name: sendScenarioEvent
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/SendScenarioEvent
PipelineProcessor object: atg.commerce.pricing.processor.ProcSendScenarioEvent
Transitions: None, this is the only link in the chain and will cause the PipelineManager to return to the caller.
Notes: This processor sends scenario action events to the scenario server.

Monday, October 1, 2012

validateForCheckout Pipeline Chain : ATG




The validateForCheckout pipeline chain verifies that the Order is ready for checkout. The validateForCheckout pipeline chain is executed by the validateOrder() method in the OrderManager and the processOrder pipeline chain. The validateOrder() method adds the given Order, Locale, and OrderManager to its parameter list, which is supplied to the executing chain. The pipeline chain’s transaction mode is TX_REQUIRED.

The following list describes each processor in the pipeline chain:


1.PipelineLink Name: validateOrderForCheckout 
This processor validates that there is at least one ShippingGroup, one PaymentGroup, and one CommerceItem in the Order before checking out.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ValidateOrderForCheckout 
PipelineProcessor object: atg.commerce.order.processor.ProcValidateOrderForCheckout 
Transitions: return value of 1 will execute verifyOrderAddresses next

2.PipelineLink Name: verifyOrderAddresses 
This processor verifies the given addresses in the HardgoodShippingGroup and CreditCard objects. It does this by calling the verifyAddress() method in the AddressVerificationProcessor, which is configured in the bprocessor. Note: The AddressVerificationProcessor is not a pipeline processor.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/VerifyOrderAddresses 
PipelineProcessor object: atg.commerce.order.processor.ProcVerifyOrderAddresses 
Transitions: return value of 1 will execute validateShippingGroupsForCheckout next

3.PipelineLink Name: validateShippingGroupsForCheckout 
This processor validates ShippingGroups before checking an Order out. It checks that all CommerceItems in the Order are assigned to ShippingGroups and that all the required fields in all the ShippingGroups, regardless of type, are not null or empty String.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ValidateShippingGroupsForCheckout 
PipelineProcessor object: atg.commerce.order.processor.ProcValidateShippingGroupsForCheckout
Transitions: return value of 1 will execute creditCardModCheck next

4.PipelineLink Name: creditCardModCheck 
This processor does a mod check on credit card numbers to see if they are valid. The verifyCreditCard method of the atg.payment.creditcard.CreditCardTools class is called on each credit card number in the Order.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/CreditCardModCheck 
PipelineProcessor object: atg.commerce.order.processor.ProcCreditCardModCheck 
Transitions: return value of 1 will execute validatePaymentGroupsForCheckout next

5.PipelineLink Name: validatePaymentGroupsForCheckout 
This processor validates PaymentGroups before checking an Order out. It checks that all CommerceItems, shipping costs, and tax in the Order are assigned to PaymentGroups. It also checks that all the required fields in all the PaymentGroups, regardless of type, are not null or an empty String.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ValidatePaymentGroupsForCheckout 
PipelineProcessor object: atg.commerce.order.processor.ProcValidatePaymentGroupsForCheckout 
Transitions: return value of 1 will execute validateShippingCostsForCheckout next

6.PipelineLink Name: validateShippingCostsForCheckout 
This processor validates that all shipping costs are accounted for by a PaymentGroup. Shipping costs are accounted for if there is only one PaymentGroup and it has no Relationships, if the ShippingGroup has been assigned to a PaymentGroup, or if an order level Relationship exists in the Order that covers the entire amount of the Order.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ValidateShippingCostsForCheckout 
PipelineProcessor object: atg.commerce.order.processor.ProcValidateShippingCostsForCheckout 
Transitions: return value of 1 will execute validateOrderCostsForCheckout next.

7.PipelineLink Name: validateOrderCostsForCheckout 
This processor validates that all order costs are accounted for by a PaymentGroup. Order costs are accounted for if there is only one PaymentGroup and it has no Relationships or if order level Relationships exist in the Order that cover the entire amount of the Order.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ValidateOrderCostsForCheckout 
PipelineProcessor object: atg.commerce.order.processor.ProcValidateOrderCostsForCheckout 
Transitions: return value of 1 will execute validateHandlingInstructionsForCheckout next

8.PipelineLink Name: validateHandlingInstructionsForCheckout 
This processor validates that the total quantities in the HandlingInstructions do not exceed the amount assigned to the ShippingGroup. It does this by iterating over all the HandlingInstructions in the ShippingGroups and validating that the sum of the quantities in the HandlingInstructions do not exceed that which is assigned to the ShippingGroup. It will also catch errors if HandlingInstructions contain errors such as invalid ShippingGroup and CommerceItem IDs or CommerceItems that are not assigned to the ShippingGroup that contains the HandlingInstruction.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ValidateHandlingInstructionsForCheckout
PipelineProcessor object: atg.commerce.order.processor.ProcValidateHandlingInstructionsForCheckout
Transitions: return value of 1 will execute validateCurrencyCodes next

9.PipelineLink Name: validateCurrencyCodes 
Verifies that all the PriceInfo objects in the Order have been priced using the same currency code. The currency code in the OrderPriceInfo object is the one that must be matched. The code checks the TaxPriceInfo object’s currency code in the Order and all the ShippingPriceInfo and ItemPriceInfo currency codes in all the ShippingGroups and CommerceItems, respectively.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ValidateCurrencyCodes 
PipelineProcessor object: atg.commerce.order.processor.ProcValidateCurrencyCodes 
Transitions: Return value of 1 executes checkForDiscontinuedProducts next.

10.PipelineLink Name: checkForDiscontinuedProducts 
Ensures that the order does not contain any products that are no longer available
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/CheckForDiscontinuedProducts 
PipelineProcessor object: atg.commerce.order.processor.ProcCheckForDiscontinuedProducts 
Transitions: None, this is the last link in the chain and will cause the PipelineManager to return to the caller.

processOrder Pipeline Chain : ATG


The processOrder pipeline chain submits the given Order for checkout. The processOrder pipeline chain is executed by the processOrder() method in the OrderManager. The processOrder() method adds the given Order, Profile, Request, Locale, and OrderManager to its parameter list, which is supplied to the executing chain. The pipeline chain’s transaction mode is TX_REQUIRED.

The following list describes each processor in the pipeline chain:

1.PipelineLink Name: executeValidateForCheckoutChain 
This processor causes the validateForCheckout chain to be executed. If the execution of this chain causes any errors, then execution will be returned to the caller.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ExecuteValidateForCheckoutChain 
PipelineProcessor object: atg.commerce.order.processor.ProcExecuteChain 
Transitions: In ATG Consumer Commerce, return value of 1 executes checkForExpiredPromotions next. In ATG Business Commerce, return value of 1 executes executeApproveOrderChain next.

2.PipelineLink Name: executeValidateForCheckoutChain 
This processor causes the validateForCheckout chain to be executed. If the execution of this chain causes any errors, then execution will be returned to the caller.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/ExecuteValidateForCheckoutChain 
PipelineProcessor object: atg.commerce.order.processor.ProcExecuteChain 
Transitions: In ATG Consumer Commerce, return value of 1 executes checkForExpiredPromotions next. In ATG Business Commerce, return value of 1 executes executeApproveOrderChain next.

3.(ATG Business Commerce only)
PipelineLink Name: stopChainIfOrderRequiresApproval 
This processor checks whether the order has been determined to require approval. Specifically, it checks whether the state of the order is PENDING_APPROVAL. If it isn’t, the order moves to the next processor in processOrder. If it is, execution of the processOrder chain stops.
Transactional mode: TX_MANDATORY
Nucleus component: 
/atg/commerce/approval/processor/StopChainIfOrderRequiresApproval 
PipelineProcessor object: 
atg.commerce.order.processor.ProcCheckOrderState 
Transitions: Return value of 1 executes executeValidatePostApprovalChain next. Return value of 2 executes executeValidateNoApprovalChain.

4.(ATG Business Commerce only)
Pipeline Link Name: executeValidatePostApprovalChain 
If the order requires approval and has been approved, this processor revalidates order information in case the approver changed anything.
Transactional mode: TX_MANDATORY
Nucleus component: 
atg/commerce/order/processor/ExecuteValidatePostApprovalChain 
PipelineProcessor object: 
atg.commerce.order.processor.ProcExecuteChain 
Transitions: Return value of 1 executes checkForExpiredPromotions next.

5.(ATG Business Commerce only)
Pipeline Link Name: executeValidateNoApprovalChain 
If the order does not require approval, finish validation.
Transactional mode: TX_MANDATORY
Nucleus component: 
atg/commerce/order/processor/ExecuteValidateNoApprovalChain 
PipelineProcessor object: 
atg.commerce.order.processor.ProcExecuteChain 
Transitions: Return value of 1 executes checkForExpiredPromotions.

6.PipelineLink Name: checkForExpiredPromotions 
This processor walks through all the promotions that are being applied to the Order and verifies that none of them have expired.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/CheckForExpiredPromotions 
PipelineProcessor object: atg.commerce.order.processor.ProcCheckForExpiredPromotions 
Transitions: return value of 1 will execute removeEmptyShippingGroups next

7.PipelineLink Name: removeEmptyShippingGroups 
This processor checks to see if there are any empty ShippingGroups in the Order. It removes any empty groups it finds. An empty ShippingGroup contains no Relationships. If the Order contains only one ShippingGroup then it will not be removed if it is empty.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/RemoveEmptyShippingGroups 
PipelineProcessor object: atg.commerce.order.processor.ProcRemoveEmptyShippingGroups 
Transitions: return value of 1 will execute removeEmptyPaymentGroups next

8.PipelineLink Name: removeEmptyPaymentGroups 
This processor checks to see if there are any empty PaymentGroups in the Order. If so then it will remove them. An empty PaymentGroup contains no Relationships. If the Order contains only one PaymentGroup then it will not be removed if it is empty.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/RemoveEmptyPaymentGroups 
PipelineProcessor object: atg.commerce.order.processor.ProcRemoveEmptyPaymentGroups 
Transitions: return value of 1 will execute createImplicitRelationships next

9.PipelineLink Name: createImplicitRelationships 
This processor adds Relationships to the Order if there is only one ShippingGroup or one PaymentGroup. If either one of these or both have no Relationships, then relationships will automatically be created. For the ShippingGroup, Relationships will be created between it and each CommerceItem. For the PaymentGroup, a Relationship will be created between itself and the Order with type OrderAmountRemaining.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/CreateImplicitRelationships 
PipelineProcessor object: atg.commerce.order.processor.ProcCreateImplicitRelationships 
Transitions: return value of 1 will execute setPaymentGroupAmount next

10.PipelineLink Name: setPaymentGroupAmount 
This processor sets the amount property of each PaymentGroup in the Order based on the Relationships in each PaymentGroup. This amount is the amount that will ultimately be debited by the PaymentManager.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/SetPaymentGroupAmount 
PipelineProcessor object: atg.commerce.order.processor.ProcSetPaymentGroupAmount 
Transitions: return value of 1 will execute moveUsedPromotions next

11.PipelineLink Name: moveUsedPromotions 
This processor updates the promotion use information in the Profile repository for the user.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/MoveUsedPromotions 
PipelineProcessor object: atg.commerce.order.processor.ProcMoveUsedPromotions 
Transitions: return value of 1 will execute authorizePayment next

12.PipelineLink Name: authorizePayment 
This processor authorizes all the payment information in the PaymentGroups. It essentially calls the authorize() method in the PaymentManager for each PaymentGroup.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/AuthorizePayment 
PipelineProcessor object: atg.commerce.order.processor.ProcAuthorizePayment 
Transitions: return value of 1 will execute updateGiftRepository next

13.PipelineLink Name: updateGiftRepository 
This processor updates the gift list repository information for the user.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/UpdateGiftRepository 
PipelineProcessor object: atg.commerce.order.processor.ProcUpdateGiftRepository 
Transitions: return value of 1 will execute sendGiftPurchasedMessage next

14.PipelineLink Name: sendGiftPurchasedMessage 
This processor sends a gift purchased message to the messaging system.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/SendGiftPurchasedMessage 
PipelineProcessor object: atg.commerce.order.processor.ProcSendGiftPurchasedMessage 
Transitions: return value of 1 will execute addOrderToRepository next

15.PipelineLink Name: addOrderToRepository 
This processor saves the Order to the Order Repository and if the user is not a registered user, adds the Order to the repository and then saves it.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/AddOrderToRepository 
PipelineProcessor object: atg.commerce.order.processor.ProcAddOrderToRepository 
Transitions: return value of 1 will execute sendPromotionUsedMessage next

16.PipelineLink Name: sendPromotionUsedMessage 
This processor sends a message to the Scenario Server for each promotion that was used in the Order signifying that the given promotion was used by the user.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/SendPromotionUsedMessage 
PipelineProcessor object: atg.commerce.order.processor.ProcSendPromotionUsedMessage 
Transitions: return value of 1 will execute sendFulfillmentMessage next

17.PipelineLink Name: sendFulfillmentMessage 
This processor sends a message to the fulfillment engine signifying that it should begin processing the Order.
Transactional mode: TX_MANDATORY
Nucleus component: /atg/commerce/order/processor/SendFulfillmentMessage 
PipelineProcessor object: atg.commerce.order.processor.ProcSendFulfillmentMessage 
Transitions: None, this is the last link in the chain and will cause the PipelineManager to return to the caller.

Popular Posts