com.ibm.commerce.order.commands

Class PromotionEngineOrderCalculateCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OrderCalculateCmd, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
    Direct Known Subclasses:
    ExternalOrderCalculateCmdImpl, VATPromotionEngineOrderCalculateCmdImpl


    public class PromotionEngineOrderCalculateCmdImpl
    extends ControllerCommandImpl
    implements OrderCalculateCmd
    This is the Promotion Engine base implementation of the OrderCalculateCmd controller command.

    Input parameters:

    Name Description
    orderId The reference number of the order to be displayed. If this parameter is omitted, this command behaves as if all of the customer's orders with the specified status for the specified store were specified. Abbreviations may be used, but only with pending orders (status is P for standard orders or NEW for advanced orders). This parameter can be repeated.
    calculationUsageId Predefined codes for calculation of discounts (-1), shipping (-2), sales tax (-3), shipping tax (-4), coupons (-5), surcharge (-6), shipping adjustment (-7). This parameter can be repeated.
    outOrderName Specifies the names of name-value pairs to be passed to a JSP. The value of each added name-value pair is the reference number of the order to be displayed. If the name is not provided, the default name orderId is used. This parameter can be repeated.
    calculationUsageId Predefined codes for calculation of discounts (-1), shipping (-2), sales tax (-3), shipping tax (-4), coupons (-5), surcharge (-6), shipping adjustment (-7). This parameter can be repeated.
    updatePrices This flag indicates whether the prices of order items will be refreshed in this command. If the value of the flag is set to "0" (default value), then the prices will not be refreshed. If the value of the flag is set to "1", then the prices will be updated.
    keepAutoAddedOrderItemsBeforeCalculate This flag indicates whether the freegift item should be kept in the order before calculating discounts. If the value of the flag is "0" (default value), the freegift item will be removed before calculating discounts and then re-added. If the value of the flag is "1", the freegift item will be kept as is.

    Output parameters:

    Name Description
    istrOutOrderNames the order IDs to be displayed
    outOfInventoryCatalogEntryId the catalog entrys which are intended to add to the order as freegift but has no inventory now.
    nonBuyableCatalogEntryId the catalog entrys which are intended to add to the order as freegift but are non-buyable now.

    Behaviour:

    For each Order specified:
    • unlock the Order
    • initialize the specified CalculationUsages that are enabled
    • if the PromotionsEngine component is enabled and freegift is to be refreshed. Call the PromotionEngine to obtain a list of CatalogEntries to add to the Order
    • for each CatalogEntry to be added to the Order, if ATP is disabled and there is insufficient inventory:
      • remove the CatalogEntry from the list
      • add the CatalogEntry identifier to the outOfInventoryCatalogEntryId list
    • call the OrderItemAddCmd controller command to add the CatalogEntries to the Order
    • call ResolveOrderItemPriceCmd to update the product total of the Order and its OrderItems
    • apply the specified CalculationUsages that are enabled
    • update the SubOrders for the Order unless that feature is disabled
    • summarize the specified CalculationUsages that are enabled
    • Finally, call the method setResponseProperties() .

    Task commands called:

    AccessBeans utilized:

    Possible callers:

    • RewardChoiceUpdateCmdImpl
    • SalesOrderPreprocessCmdImpl
    • GuestUserOrderMigrationEventListener
    • OrderItemAddCmdImpl
    • OrderItemUpdateCmdImpl
    • OrderItemDeleteCmdImpl
    • MigrateRegisteredUserEntriesCmdImpl
    • CSROrderPrepareCmdImpl
    See Also:
    OrderCalculateCmdImpl, Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PromotionEngineOrderCalculateCmdImpl

        public PromotionEngineOrderCalculateCmdImpl()
        Constructor for PromotionEngineOrderCalculateCmdImpl.