com.ibm.commerce.order.commands

Class OrderProcessCmdImpl

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


    public class OrderProcessCmdImpl
    extends OrderBaseCmdImpl
    implements OrderProcessCmd
    This is the default implementation of the controller command OrderProcessCmd.

    Input parameters:

    Name Description
    langId Sets or resets the preferred language for the duration of the session; the supported languages for a store are found in the STORELANG table.
    forUser The logon ID of the user on whose behalf the command will be run. Only a person with the authority to process orders can specify this parameter.
    forUserId Same as forUser, but identifying the user by the internal user ID, as found in the USERS table.
    storeId The reference number of the store with which the order is to be placed. This value is ignored unless an error occurs before the order is resolved. It is used only to call the correct store's exception handler.
    orderId The reference number of the order to be processed. This parameter can be repeated.
    billtoAddressId The reference number of the address to bill.
    field1 Customizable field1.
    field2 Customizable field2.
    field3 Customizable field3.
    notifyMerchant Whether the store is notified when the order processing is complete. E-mail notifications are only sent when WebSphere Commerce is configured with WebSphere Commerce Payments. 1=Yes ,0=No
    notifyShopper Whether the customer is notified when the order processing is complete. E-mail notifications are only sent when WebSphere Commerce is configured with WebSphere Commerce Payments. 1=Yes, 0=No
    notifyOrderSubmitted Specifies whether the customer is notified when the order is successfully submitted for processing. 1=Yes0=No (default)
    quoteExpiryPolicy Defines 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 result of: the order last update timestamp plus the number of seconds specified in the QUOTEGOODFOR column of the STORE table. This parameter may have three values:
    alwaysProceed - Always proceed with processing the order after recalculating order total.
    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 specified by the quoteExpiredUrl.
    neverProceed - Always redirect to the URL specified by the quoteExpiredUrl parameter.
    quoteExpiredURL Specifies the URL to which to redirect if the order total expired in agreement with the expiry policy specified by the quoteExpiryPolicy parameter.
    availabilityChangeURL Specifies the URL to redirect to. The estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory). If the result is more than the time interval specified by the maxAvailabilityChange parameter, redirect to the specified URL.
    This parameter is ignored if ATP inventory allocation is not enabled.
    maxAvailabilityChange Specifies the time interval, in seconds, mentioned in the availabilityChangeURL parameter description. The default value is 3600 (one hour). This parameter is ignored if the availabilityChangeURL parameter is not specified, or if ATP inventory allocation is not enabled.
    noInventoryURL Specifies the URL to which to redirect 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.
    quotationSubmission Controls whether the relType attribute values for "selection" OrderQuotationRel objects that identify the order being processed with their childId attribute must be changed to "submission". A value of 0 does not change the relType attributes of the OrderQuotationRel objects in the list to indicate "submission". A value of 1 changes the relType attributes of the OrderQuotationRel objects in the list to indicate "submission". The default value is 0.
    reduceParentQuantities Controls whether quantities of order items in the selection parent order are reduced by the quantities of order items in the order being processed. A value of 0 does not reduce parent quantities; a value of 1 reduces parent quantities. The default value is 0.
    In any case, the parent order is only updated when:
    • It has a status attribute of P or E.
    • The order items have the same CatalogEntryId, SpecifiedItemId, and correlationGroup attribute values as the order items in the order being processed are updated.
    transferMode Specifies the mode of transfer to an external system. A value of 0 transfers the order without payment information (shopping-cart transfer). A value of 1 transfers the order with payment information (purchase-order transfer). The default value of this parameter is 0.
    externalUserId Specifies a user ID to be sent with the order transfer request.
    externalPassword Specifies a password for the user ID specified by the externalUserId parameter.
    continue Controls whether or not order processing continues to the next order when there is a failure in processing one of multiple orders. A value of 0 specifies that the process should not continue; a value of 1 specifies that the process should continue. The default value is 0.
    isPIAddNeeded Controls whether the PIAddCmd is to be called or not.
    payMethodId the payment method ID. If this parameter is not set, the command will use policyId to determine a payment method ID.
    policyId the payment policy ID. the default policy ID is "-9810".
    billing_address_id the billing address Id of the Payment Instruction. If this parameter is not set, it will use the billing address of the order.
    notify_[msgtype]_transportname_attributename Specifies configuration attributes applicable to order notification for a given message type and message transport. Message type is optional. If it is not specified, the configuration attribute is applicable to all message types.
    For example:
    Send the "order received" e-mail notification for orders processed by this command to 2 e-mail addresses, john@ibm.com and victor@ibm.com:
    notify_OrderReceived_EMailSender_recipient=john@ibm.com,victor@ibm.com
    where OrderReceived is from MSGTYPES.NAME and EMailSender is from TRANSPORT.NAME. Send all types of order e-mail notifications to jack@ibm.com: notify_EMailSender_recipient=jack@ibm.com
    where EMailSender is from TRANSPORT.NAME.
    Note: If you want to send an e-mail notification to a guest customer, then you must capture the e-mail address of the guest customer. Set the e-mail address as the value of the notify_[msgtype]_transportname_attributename parameter.
    billtoAddressId_i The reference number of the address to bill for the group i.
    orderId_i (Required) The reference number of the order to be processed. This parameter can be repeated.
    notifyMerchant_i Whether the store is notified when the order processing is complete. E-mail notifications are only sent when WebSphere Commerce is configured with WebSphere Commerce Payments. 1=Yes, 0=No
    notifyShopper_i Whether the customer is notified when the order processing is complete for the enumeration group i. E-mail notifications are only sent when WebSphere Commerce is configured with WebSphere Commerce Payments. 1=Yes, 0=No
    notifyOrderSubmitted_i Specifies whether the customer is notified when the order is successfully submitted for processing for the enumeration group i. 1=Yes0=No (default)
    field1_i Customizable fields1 for the group i.
    field2_i Customizable fields2 for the group i.
    field3_i Customizable fields3 for the group i.
    PONumber_i the purchase order Id for this order for the group i. If the purchaseorder_id is specified, this value will be replaced.
    purchaseorder_id_i the purchase order Id for this order for the group i.

    Output parameters:

    Name Description
    orderId the orders Id processed. This parameter can be repeated.
    warningErrorMessage the warning error message for the first order.
    warningErrorMessageKey the warning error message key for the first order.

    Behaviour:

    • Resolve the orders passed to this command through orderIdparameter.
    • Call ProcessOrderCmd to process these orders.
    • Resolve the enumeration groups according to orderId_iparameter.
    • Call raiseBusinessEvents() to raise the event.
    • Put the orders Id to the response property of the command.
    • Check the payment status of the first successful order, put warning error message if necessary.

    Task commands called:

    AccessBeans used:

    Possible callers:

    • CompleteOrderCmdImpl
    • ScheduledOrderProcessCmdImpl
    • RFQToOrderCreateCmdImpl
    • CSROrderProcessImpl
    • RFQCompleteCmdImpl
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.Short VAL_NOTIFY_YES
        Constant VAL_NOTIFY_YES.
      • VAL_NOTIFY_NO

        public static final java.lang.Short VAL_NOTIFY_NO
        Constant VAL_NOTIFY_NO.
    • Constructor Detail

      • OrderProcessCmdImpl

        public OrderProcessCmdImpl()
    • Method Detail

      • checkInventory

        public static void checkInventory(java.lang.Long anOrderRn,
                                          java.lang.Integer anStoreId,
                                          CommandContext aProcessingContext)
                                   throws ECException
        This helper method which calls the default implementation of the CheckInventoryCmd task command This method is deprecated. It can only be used when ATP is disabled.
        Parameters:
        anOrderRn - Order reference number
        anStoreId - Store reference number
        aProcessingContext - Command context
        Throws:
        ECException
      • checkInventory

        public static void checkInventory(java.lang.Long anOrderRn,
                                          java.lang.Integer anStoreId,
                                          CommandContext aProcessingContext,
                                          java.lang.String astrTaskName)
                                   throws ECException
        This is a helper method that calls a specified implementation of the CheckInventoryCmd task command This method is deprecated. It can only be used when ATP is disabled.
        Parameters:
        anOrderRn - Order reference number
        anStoreId - Store reference number
        aProcessingContext - Command context
        astrTaskName - Name of the task command to use to checkInventory
        Throws:
        ECException
      • extendOrderProcess

        public static void extendOrderProcess(java.lang.Long anOrderRn,
                                              java.lang.Integer anStoreId,
                                              CommandContext aProcessingContext,
                                              TypedProperty ahshRequestProperties)
                                       throws ECException
        This is a helper method that calls the ExtOrderProcessCmd task command
        Parameters:
        anOrderRn - Order reference number to do extended processing on
        anStoreId - Store reference number
        aProcessingContext - Command context
        ahshRequestProperties - Name value pairs
        Throws:
        ECException
      • getAvailabilityChangeURL

        public java.lang.String getAvailabilityChangeURL()
        Gets the URL to redirect to. The estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory). If the result is more than the time interval specified by the setMaxAvailabilityChange method, this method is called.
        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:
        quote submission parameter
      • getOrderRn

        public java.lang.Long getOrderRn()
        Deprecated. Replaced by [0]
        Gets the first order id in the list of order ids passed as input to the command.
        Returns:
        order id
      • 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:
        quote expiry 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.
      • invokeOrderMessaging

        public static void invokeOrderMessaging(java.lang.Long anOrderRn,
                                                java.lang.Integer anStoreId,
                                                CommandContext aProcessingContext,
                                                TypedProperty ahshRequestProperties)
                                         throws ECException
        This is a helper method that calls the OrderMessagingCmd task command
        Parameters:
        anOrderRn - Order reference number to do extended processing on
        anStoreId - Store reference number
        aProcessingContext - Command context
        ahshRequestProperties - Name value pairs
        Throws:
        ECException
      • isReadyToCallExecute

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

        public void performExecute()
                            throws ECException
        This method contains the main business logic of this command implementation. After processing the orders, it then calls raiseBusinessEvents() to raise ORDER_SUBMISSION_EVENT. Finally it sets the response properties with the warning/error messages if any.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • 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
      • reverseUpdateInventory

        public static void reverseUpdateInventory(java.lang.Long anOrderRn,
                                                  java.lang.Integer anStoreId,
                                                  CommandContext aProcessingContext)
                                           throws ECException
        A helper method that calls the default implementation of the ReverseUpdateInventoryCmd task command
        Parameters:
        anOrderRn - Order reference number
        anStoreId - Store reference number
        aProcessingContext - Command context
        Throws:
        ECException
      • reverseUpdateInventory

        public static void reverseUpdateInventory(java.lang.Long orderId,
                                                  java.lang.Integer anStoreId,
                                                  CommandContext aProcessingContext,
                                                  java.lang.String astrTaskName)
                                           throws ECException
        A helper method that calls a specified implementation of ReverseUpdateInventoryCmd
        Parameters:
        orderId - Order reference number
        anStoreId - Store reference number
        aProcessingContext - Command context
        astrTaskName - Name of the task command to use to Reverse Update Inventory
        Throws:
        ECException
      • setAvailabilityChangeURL

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

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

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

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

        public void setField3(java.lang.String astrField3)
        Sets merchant-customizable field three.
        Specified by:
        setField3 in interface OrderProcessCmd
        Parameters:
        astrField3 - filed3
      • setMaxAvailabilityChange

        public void setMaxAvailabilityChange(java.lang.Long newMaxAvailabilityChange)
        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 OrderProcessCmd
        Parameters:
        newMaxAvailabilityChange - time interval.
      • setNoInventoryURL

        public void setNoInventoryURL(java.lang.String newNoInventoryURL)
        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 OrderProcessCmd
        Parameters:
        newNoInventoryURL - URL
      • setNotifyMerchant

        public void setNotifyMerchant(java.lang.Short newNotifyMerchant)
        Specifies whether the store should be notified when the order processing is complete. Valid values include :

        1=Yes

        0=No

        Specified by:
        setNotifyMerchant in interface OrderProcessCmd
        Parameters:
        newNotifyMerchant - notify merchant parameter.
      • setNotifyOrderSubmitted

        public void setNotifyOrderSubmitted(java.lang.Short newNotifyOrderSubmitted)
        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 OrderProcessCmd
        Parameters:
        newNotifyOrderSubmitted - notify order submitted parameter.
      • setNotifyShopper

        public void setNotifyShopper(java.lang.Short newNotifyShopper)
        Specifies whether the customer should be notified when the order processing is complete. Valid values include :

        1=Yes

        0=No

        Specified by:
        setNotifyShopper in interface OrderProcessCmd
        Parameters:
        newNotifyShopper - notify shopper parameter.
      • setQuotationSubmission

        public void setQuotationSubmission(java.lang.String astrQuotationSubmission)
        Sets the quotationSubmission parameter.
        Specified by:
        setQuotationSubmission in interface OrderProcessCmd
        Parameters:
        astrQuotationSubmission - quotation submission parameter.
      • setOrderRn

        public void setOrderRn(java.lang.Long anOrderRn)
        Sets the order reference number.
        Specified by:
        setOrderRn in interface OrderProcessCmd
        Parameters:
        anOrderRn - order id.
      • setQuoteExpiredURL

        public void setQuoteExpiredURL(java.lang.String newQuoteExpiredURL)
        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 OrderProcessCmd
        Parameters:
        newQuoteExpiredURL - URL.
      • setQuoteExpiryPolicy

        public void setQuoteExpiryPolicy(java.lang.String newQuoteExpiryPolicy)
        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 result of: the 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 OrderProcessCmd
        Parameters:
        newQuoteExpiryPolicy - quote expiry policy.
      • setReduceParentQuantities

        public void setReduceParentQuantities(java.lang.String astrReduceParentQuantities)
        Sets the reduceParentQuantities parameter.
        Specified by:
        setReduceParentQuantities in interface OrderProcessCmd
        Parameters:
        astrReduceParentQuantities - reduce parent quantities parameter.
      • setTransferMode

        public void setTransferMode(java.lang.String transferMode)
        Sets the transferMode property of the command.
        Specified by:
        setTransferMode in interface OrderProcessCmd
        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).
      • updateInventory

        public static void updateInventory(java.lang.Long anOrderRn,
                                           java.lang.Integer anStoreId,
                                           CommandContext aProcessingContext)
                                    throws ECException
        A helper method that calls the default implementation of the UpdateInventoryCmd task command
        Parameters:
        anOrderRn - Order reference number
        anStoreId - Store reference number
        aProcessingContext - Command context
        Throws:
        ECException
      • updateInventory

        public static void updateInventory(java.lang.Long orderId,
                                           java.lang.Integer anStoreId,
                                           CommandContext aProcessingContext,
                                           java.lang.String astrTaskName)
                                    throws ECException
        A helper method that calls a specified implementation of UpdateInventoryCmd
        Parameters:
        orderId - Order id
        anStoreId - Store reference number
        aProcessingContext - Command context
        astrTaskName - Name of the task command to use to Update Inventory
        Throws:
        ECException
      • getExternalUserId

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

        public void setExternalUserId(java.lang.String astrExternalUserId)
        Sets the external user id
        Specified by:
        setExternalUserId in interface OrderProcessCmd
        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 OrderProcessCmd
        Parameters:
        astrExternalPassword - The external password to set
      • getOrderRns

        public java.lang.String[] getOrderRns()
        Gets the order ids for processed orders
        Returns:
        Returns a Long[]
      • setOrderRns

        public void setOrderRns(java.lang.String[] anOrderRns)
        Sets the orders to be processed
        Parameters:
        anOrderRns - The orders to set
      • getOrders

        public OrderAccessBean[] getOrders()
        Gets the orders to be processed
        Returns:
        Returns an OrderAccessBean[]
      • setOrders

        public void setOrders(OrderAccessBean[] anabOrders)
        Sets the orders to be processed
        Parameters:
        anabOrders - The orders to set
      • getContinue

        public boolean getContinue()
        Gets the value of the 'continue' policy. The value of the policy is 'true' if processing of all orders is attempted even if some of the orders failed processing.
        Returns:
        Returns a boolean
      • setContinue

        public void setContinue(boolean aContinue)
        Sets the value of the 'continue' policy.
        Parameters:
        aContinue - The value to set
      • getNotificationAttributes

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

        public void setNotificationAttributes(java.util.Hashtable aNotificationAttributes)
        Sets the attributes for order notification
        Specified by:
        setNotificationAttributes in interface OrderProcessCmd
        Parameters:
        aNotificationAttributes - The attributes to set
      • isPerformPIAdd

        public boolean isPerformPIAdd()
        Returns whether PIAddCmd will be called.
        Returns:
        boolean whether PIAddCmd will be called.
      • setPerformPIAdd

        public void setPerformPIAdd(boolean piAddNeeded)
        Sets whether PIAddCmd will be called.
        Parameters:
        piAddNeeded - boolean flag indicates if PIAddCmd will be executed.
      • isUpdateOrderChannel

        public boolean isUpdateOrderChannel()
        Returns whether to update channel id.
        Returns:
        boolean whether need to update channel id.
      • setUpdateOrderChannel

        public void setUpdateOrderChannel(boolean updateChannel)
        Sets whether to update channel id
        Parameters:
        updateChannel -