com.ibm.commerce.tools.optools.order.commands

Class CSROrderRollBackCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, ToolsControllerCommand, CSROrderRollBackCmd, 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


    public class CSROrderRollBackCmdImpl
    extends ToolsControllerCommandImpl
    implements CSROrderRollBackCmd
    This is the default implementation of the CSROrderProcessCmd command.

    Behavior

    • Change the first order so that it will contain the same order items as those order items in the backup order.
      • If the first order has an order item with a SKU which does not exist in the backup order. This command will call OrderItemDeleteCmd to delete this order item from the first order.
      • If the backup order has an order item with a SKU which does not exist in the first order. This command will call OrderItemAddCmd to add the order item to the first order.
      • If the first order has an order item with a SKU which does exist in the backup order. This command will compare the following attributes of those two order items:
        1. Quantity
        2. Shipping address
        3. Shipping mode
        4. Contract ID
        If there is any difference found, the command will call OrderItemUpdateCmd to update the order item of the first order.
      • Set the shipping charge, menu adjustment and coupons of the first order as those values provided by the XML.
    • Re-process the first order.
      • Call OrderPrepareCmd to prepare the first order.
      • Remove the payment of the first order.
      • Call OrderProcessCmd to process the first order.
      • If the grand total of the first order is different from the value in the XML, the command will return a warning message.
    • If the second order exists, this command will cancel the second order.
    • This command will remove the backup order after all the changes are made to the first order successfully. If the command fails to remove the backup order, the command will return a warning message.

    This command calls the following Commands:

    This command uses the following AccessBeans:

    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String NOTEBOOK_URL
        The return url for a notebook widget.
        See Also:
        Constant Field Values
      • ERRTASK_NAME

        public static java.lang.String ERRTASK_NAME
        Error handling view name for this command.
    • Constructor Detail

      • CSROrderRollBackCmdImpl

        public CSROrderRollBackCmdImpl()
    • Method Detail

      • getBackupOrderId

        public java.lang.String getBackupOrderId()
        Returns backup order ID.
        Returns:
        The backup order ID.
      • getCustomerId

        public java.lang.String getCustomerId()
        Returns customer ID.
        Returns:
        The customer ID.
      • getFirstOrderId

        public java.lang.String getFirstOrderId()
        Returns first order ID.
        Returns:
        The first order ID.
      • getNLS

        public java.util.Hashtable getNLS()
        Returns NLS properties.
        Returns:
        The NLS properties.
      • getOrgCmdContext

        public CommandContext getOrgCmdContext()
        Returns original command context.
        Returns:
        The original command context.
      • getOrgLangId

        public java.lang.Integer getOrgLangId()
        Returns original language ID.
        Returns:
        The original language ID.
      • getOrigOrderLastUpdate

        public java.lang.String getOrigOrderLastUpdate()
        Returns the origOrderLastUpdate.
        Returns:
        java.lang.String
      • getOrgLocale

        public java.util.Locale getOrgLocale()
        Returns original Locale.
        Returns:
        The original Locale.
      • getOrgReqProperties

        public TypedProperty getOrgReqProperties()
        Returns original request properties.
        Returns:
        The original request properties.
      • getOrigOrderCouponIds

        public java.lang.String getOrigOrderCouponIds()
        Returns the string of coupons IDs used in the original order.
        Returns:
        The coupon IDs used in the original order.
      • getOrigOrderGrandTotal

        public java.math.BigDecimal getOrigOrderGrandTotal()
        Returns original order grand total.
        Returns:
        The original order grand total.
      • getOrigOrderLevelMenuAdjustment

        public java.math.BigDecimal getOrigOrderLevelMenuAdjustment()
        Returns original order level menu adjustment.
        Returns:
        The original order level menu adjustment.
      • getOrigOrderStatus

        public java.lang.String getOrigOrderStatus()
        Returns the origOrderStatus.
        Returns:
        java.lang.String
      • getOrigShippingCharge

        public java.math.BigDecimal getOrigShippingCharge()
        Returns the original shipping charge.
        Returns:
        The original shipping charge.
      • getRedirectURL

        public java.lang.String getRedirectURL()
        Returns redirect URL.
        Returns:
        The redirect URL.
      • getSecondOrderId

        public java.lang.String getSecondOrderId()
        Returns the ID of the second order.
        Returns:
        The ID of the second order.
      • getXMLFile

        public java.lang.String getXMLFile()
        Returns XML file.
        Returns:
        The XML file.
      • performExecute

        public void performExecute()
                            throws ECException
        This method performs rollback changes done to the first order from the data in the backup order. Once the rollback is done successfully, the command will delete the back up order. If the second order exists, this method will cancel the second order.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - If fails to roll back order.
      • setOrigOrderLastUpdate

        public void setOrigOrderLastUpdate(java.lang.String inOrigOrderLastUpdate)
        Sets the origOrderLastUpdate.
        Parameters:
        inOrigOrderLastUpdate - The origOrderLastUpdate to set
      • setOrigOrderCouponIds

        public void setOrigOrderCouponIds(java.lang.String newOrigOrderCouponIds)
        Sets the list of coupons used in the original order
        Parameters:
        newOrigOrderCouponIds - IDs of coupons used in the original order
      • setOrigOrderLevelMenuAdjustment

        public void setOrigOrderLevelMenuAdjustment(java.lang.String tmpValue)
        Sets original order level menu adjustment.
        Parameters:
        tmpValue - The original order level menu adjustment.
      • setOrigShippingCharge

        public void setOrigShippingCharge(java.lang.String tmpValue)
        Sets original order shipping charge.
        Parameters:
        tmpValue - The original order shipping charge.
      • setOrigOrderStatus

        public void setOrigOrderStatus(java.lang.String inOrigOrderStatus)
        Sets the origOrderStatus.
        Parameters:
        inOrigOrderStatus - The origOrderStatus to set