com.ibm.commerce.order.commands

Class ProcessOrderCmdImpl

    • Constructor Detail

      • ProcessOrderCmdImpl

        public ProcessOrderCmdImpl()
    • Method Detail

      • getAvailabilityChangeURL

        public java.lang.String getAvailabilityChangeURL()
        This method gets the URL to redirect to when the estimated availability time plus the shipping offset is more than the time interval. The shipping offset occurs for any order item moves into the future (as a result of allocating or backordering inventory). The time interval is specified by the setMaxAvailabilityChange method.
        Returns:
        URL
      • getBillToRn

        public java.lang.Long getBillToRn()
        Gets the reference number of the address to bill.
        Returns:
        address id.
      • getField1

        public java.lang.Integer getField1()
        Gets merchant-customizable field one.
        Returns:
        field1
      • getField2

        public java.math.BigDecimal getField2()
        Gets merchant-customizable field two.
        Returns:
        field2
      • getField3

        public java.lang.String getField3()
        Gets merchant-customizable field three.
        Returns:
        field3
      • getMaxAvailabilityChange

        public java.lang.Long getMaxAvailabilityChange()
        Gets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method.
        Returns:
        time interval.
      • getNoInventoryURL

        public java.lang.String getNoInventoryURL()
        Gets the URL to redirect to if any of the order items in the order cannot be allocated or backordered.
        Returns:
        URL
      • getNotifyMerchant

        public java.lang.Short getNotifyMerchant()
        Determines whether the store should be notified when the order processing is complete.
        Returns:
        notify merchant parameter.
      • getNotifyOrderSubmitted

        public java.lang.Short getNotifyOrderSubmitted()
        Determines whether the customer should be notified when the order is successfully submitted for processing.
        Returns:
        notify order submitted parameter.
      • getNotifyShopper

        public java.lang.Short getNotifyShopper()
        Determines whether the customer should be notified when the order processing is complete.
        Returns:
        notify shopper parameter.
      • getQuotationSubmission

        public java.lang.String getQuotationSubmission()
        Gets the quotationSubmission parameter.
        Returns:
        quotation submission parameter.
      • getOrderRn

        public java.lang.Long getOrderRn()
        Gets the order reference number.
        Returns:
        order id
      • getExternalUserId

        public java.lang.String getExternalUserId()
        Gets the external user id
        Returns:
        external user id
      • setExternalUserId

        public void setExternalUserId(java.lang.String astrExternalUserId)
        Sets the external user id
        Specified by:
        setExternalUserId in interface ProcessOrderCmd
        Parameters:
        astrExternalUserId - The external user id to set
      • getExternalPassword

        public java.lang.String getExternalPassword()
        Gets the external password
        Returns:
        Returns a String
      • setExternalPassword

        public void setExternalPassword(java.lang.String astrExternalPassword)
        Sets the external password
        Specified by:
        setExternalPassword in interface ProcessOrderCmd
        Parameters:
        astrExternalPassword - The external password to set
      • getQuoteExpiredURL

        public java.lang.String getQuoteExpiredURL()
        Gets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.
        Returns:
        URL
      • getQuoteExpiryPolicy

        public java.lang.String getQuoteExpiryPolicy()
        Gets the policy which determines the command behaviour if the order total expires or an order item's fulfillment center changes during inventory allocation.
        Returns:
        quote expiry policy
      • getReduceParentQuantities

        public java.lang.String getReduceParentQuantities()
        Gets the reduceParentQuantities parameter.
        Returns:
        reduce parent quantities parameter.
      • getResponseProperties

        public TypedProperty getResponseProperties()
        Gets the response properties object for the calling controller command to use.
        Specified by:
        getResponseProperties in interface ProcessOrderCmd
        Returns:
        response properties.
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Checks the validity of the parameters
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        boolean
      • validateOrderPITotalAmount

        public void validateOrderPITotalAmount()
                                        throws ECException,
                                               javax.persistence.NoResultException
        Check if PI total amount matches order total amount.
        Throws:
        ECException
        javax.persistence.NoResultException
      • createOrderLineAuditRecord

        public void createOrderLineAuditRecord()
                                        throws javax.persistence.NoResultException,
                                               javax.naming.NamingException,
                                               java.sql.SQLException
        Create an audit record which stores the count of order items in this order.
        Throws:
        javax.persistence.NoResultException
        javax.naming.NamingException
        java.sql.SQLException
      • performExecute

        public void performExecute()
                            throws ECException
        This method performs the business logic of the command. It sets the response properties so that a successful execution will redirect to OrderOKView. If either UBF is not enabled or it is enabled but Approval is not required, call PreProcessOrderCmd. If UBF is not enabled, it calls mergeShopperPayInfo(OrderAccessBean) to merge the payment info for this order. It calls handleOrderFraud(OrderAccessBean) to detect any fraud order. It then configures the order notification and calls checkOrderAndItemTotals() to perform validation on order totals and order Item totals. It calls DoInventoryActionCmd with action ALLOCATE_INVENTORY to update inventory. It calls getInitialAmount() to retrieve the initial payment amount used for Payment actions during EDP PrimePayment. If itís bigger than order total, throw exception. It calls UpdateSpendingLimitCmd to check the trading agreement spending limit and validate the PO number PrimePaymentCmd is invoked to process the payment information associated with the order. It also calls paymentAndReleaseRelationshipEnabled() to get to know whether the feature of "build relationship between payment and release" is enabled. If so, put the order items which would be processed by payment into the request properties. Then it calls RaiseOrderSubmitEventCmd to raise the order submit event. The orderstate will be updated based on the inventory status. It calls CalculationHelper to finalize calculation usages. It updates the status of the order and the order items accordingly. It configures the notification attributes so that an email notification can be sent. If OrdersMgpPersistListener is enabled, it calls PersistOrdersWithMemberGroupIdsForCurrentUserCmd to persist the order id with the member group id. It then calls ExtOrderProcessCmd to execute customization logic. It validates the order inventory status. If backorder is not allowed and one of the items in the order is backordered, throw exception. It calls TransferOrderCmd to transfer the order to external system if needed. It calls OrderMessagingCmd to generate the outbound Order Create Message. Finally it calls notifyShopper(Integer), which calls NotificationHelper to notify shopper that an order is received.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - for failures
      • reset

        public void reset()
        This method should be called after a command has been executed to reset its states variables.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setAvailabilityChangeURL

        public void setAvailabilityChangeURL(java.lang.String newAvailabilityChangeURL)
        This method sets the URL to redirect to when the estimated availability time plus the shipping offset is more than the time interval. The shipping offset occurs for any order item moves into the future (as a result of allocating or backordering inventory). The time interval is specified by the setMaxAvailabilityChange method. This parameter is ignored if ATP inventory allocation is not enabled.
        Specified by:
        setAvailabilityChangeURL in interface ProcessOrderCmd
        Parameters:
        newAvailabilityChangeURL - URL
      • setBillToRn

        public void setBillToRn(java.lang.Long anBillToRn)
        This method sets the reference number of the address to bill.
        Specified by:
        setBillToRn in interface ProcessOrderCmd
        Parameters:
        anBillToRn - address id.
      • setField1

        public void setField1(java.lang.Integer anField1)
        This method sets merchant-customizable field one.
        Specified by:
        setField1 in interface ProcessOrderCmd
        Parameters:
        anField1 - field1
      • setField2

        public void setField2(java.math.BigDecimal adField2)
        This method sets merchant-customizable field two.
        Specified by:
        setField2 in interface ProcessOrderCmd
        Parameters:
        adField2 - field2
      • setField3

        public void setField3(java.lang.String astrField3)
        This method sets merchant-customizable field three.
        Specified by:
        setField3 in interface ProcessOrderCmd
        Parameters:
        astrField3 - field3
      • setMaxAvailabilityChange

        public void setMaxAvailabilityChange(java.lang.Long newMaxAvailabilityChange)
        This method sets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method. The default value is 3600 (one hour). This parameter is ignored if the availabilityChangeURL is not specified, or if ATP inventory allocation is not enabled.
        Specified by:
        setMaxAvailabilityChange in interface ProcessOrderCmd
        Parameters:
        newMaxAvailabilityChange - time interval
      • setNoInventoryURL

        public void setNoInventoryURL(java.lang.String newNoInventoryURL)
        This method sets the URL to redirect to if any of the order items in the order cannot be allocated or backordered. This parameter is ignored if ATP inventory allocation is not enabled.
        Specified by:
        setNoInventoryURL in interface ProcessOrderCmd
        Parameters:
        newNoInventoryURL - URL
      • setNotifyMerchant

        public void setNotifyMerchant(java.lang.Short newNotifyMerchant)
        This method specifies whether to notify the merchant when the order has been processed. If the value set to 1, the merchant will be notified. If the value is set to 0, the merchant will not be notified.
        Specified by:
        setNotifyMerchant in interface ProcessOrderCmd
        Parameters:
        newNotifyMerchant - notify merchant parameter
      • setNotifyOrderSubmitted

        public void setNotifyOrderSubmitted(java.lang.Short newNotifyOrderSubmitted)
        This method specifies whether the customer should be notified when the order is successfully submitted for processing. Valid values include :

        1=Yes

        0=No (default)

        Specified by:
        setNotifyOrderSubmitted in interface ProcessOrderCmd
        Parameters:
        newNotifyOrderSubmitted - notify order submitted parameter.
      • setNotifyShopper

        public void setNotifyShopper(java.lang.Short newNotifyShopper)
        This method specifies whether to notify the shopper when the order has been processed. If the value set to 1, the shopper will be notified. If the value is set to 0, the shopper will not be notified.
        Specified by:
        setNotifyShopper in interface ProcessOrderCmd
        Parameters:
        newNotifyShopper - notify shopper parameter.
      • setOrderRn

        public void setOrderRn(java.lang.Long anOrderRn)
        This method sets the order reference number.
        Specified by:
        setOrderRn in interface ProcessOrderCmd
        Parameters:
        anOrderRn - order id
      • setQuotationSubmission

        public void setQuotationSubmission(java.lang.String astrQuotationSubmission)
        This method sets the quotationSubmission parameter.
        Specified by:
        setQuotationSubmission in interface ProcessOrderCmd
        Parameters:
        astrQuotationSubmission - quotation submission parameter.
      • setQuoteExpiredURL

        public void setQuoteExpiredURL(java.lang.String newQuoteExpiredURL)
        This method sets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.
        Specified by:
        setQuoteExpiredURL in interface ProcessOrderCmd
        Parameters:
        newQuoteExpiredURL - URL
      • setQuoteExpiryPolicy

        public void setQuoteExpiryPolicy(java.lang.String newQuoteExpiryPolicy)
        This method sets the behavior of the command if the order total expires or an order item's fulfillment center changes during inventory allocation. Order total expires if the current time is greater than or equal to the expiration time. The expiration time equals order last update timestamp plus the number of seconds specified in the QUOTEGOODFOR column of the STORE table. This parameter may have three values:

        1. alwaysProceed - always proceed with processing the order after recalculating order total.
        2. stopOnBiggerTotal - proceed with processing the order if the recalculated order total is unchanged or less than the previous order total. Otherwise, redirect to a URL set by the setQuoteExpiredUrl method.
        3. neverProceed - always redirect to the URL specified by the set by the setQuoteExpiredUrl method.
        Specified by:
        setQuoteExpiryPolicy in interface ProcessOrderCmd
        Parameters:
        newQuoteExpiryPolicy - quote expiry policy.
      • setReduceParentQuantities

        public void setReduceParentQuantities(java.lang.String astrReduceParentQuantities)
        This method sets the reduceParentQuantities parameter.
        Specified by:
        setReduceParentQuantities in interface ProcessOrderCmd
        Parameters:
        astrReduceParentQuantities - reduce parent quantities parameter.
      • setResponseProperties

        public void setResponseProperties(TypedProperty aResponseProperties)
        This method sets the response properties object for the calling controller command to use.
        Parameters:
        aResponseProperties - response properties.
      • setTransferMode

        public void setTransferMode(java.lang.String transferMode)
        This method sets the transferMode property of the command.
        Specified by:
        setTransferMode in interface ProcessOrderCmd
        Parameters:
        transferMode - - 0 - order has been transferred without the payment information (shopping cart transfer). 1 - order has been transferred with the payment information (purchase order transfer).
      • getNotificationAttributes

        public java.util.Hashtable getNotificationAttributes()
        This method gets the attributes for order notification
        Returns:
        Returns a Hashtable
      • setNotificationAttributes

        public void setNotificationAttributes(java.util.Hashtable aNotificationAttributes)
        This method sets the attributes for order notification
        Specified by:
        setNotificationAttributes in interface ProcessOrderCmd
        Parameters:
        aNotificationAttributes - The attributes to set
      • getOrder

        public OrderAccessBean getOrder()
        This method returns the order specified.
        Returns:
        OrderAccessBean
      • getPoNumber

        public java.lang.String getPoNumber()
        This method gets the parameter PO number
        Specified by:
        getPoNumber in interface ProcessOrderCmd
        Returns:
        The poNumber.
      • setPoNumber

        public void setPoNumber(java.lang.String argPoNumber)
        This method sets the parameter PO number
        Specified by:
        setPoNumber in interface ProcessOrderCmd
        Parameters:
        argPoNumber - The poNumber to set.