com.ibm.commerce.messaging.commands

Class OrderStatusCmdImpl

    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The internal copyright field.
        See Also:
        Constant Field Values
      • EMPTY_STRING

        public static final java.lang.String EMPTY_STRING
        The empty string.
        See Also:
        Constant Field Values
      • UPDATEMODE_PARTIAL

        public static final java.lang.String UPDATEMODE_PARTIAL
        The partial update mode
        See Also:
        Constant Field Values
      • UPDATEMODE_COMPLETE

        public static final java.lang.String UPDATEMODE_COMPLETE
        The complete update mode
        See Also:
        Constant Field Values
      • CONFIG_GROUPING_SYNC_ORDER

        public static final java.lang.String CONFIG_GROUPING_SYNC_ORDER
        Name of the configuration grouping for the sync order integration flow.
        See Also:
        Constant Field Values
      • CONFIG_PROPERTY_FINALIZE_PAYMENT

        public static final java.lang.String CONFIG_PROPERTY_FINALIZE_PAYMENT
        Name of the configuration property for the finalize payment setting.
        See Also:
        Constant Field Values
    • Constructor Detail

      • OrderStatusCmdImpl

        public OrderStatusCmdImpl()
    • Method Detail

      • checkOrderStatusSequence

        public boolean checkOrderStatusSequence(OrderFulfillmentStatusAccessBean orderStatusAB)
                                         throws ECException
        This method verifies that the sequence information of the order status to update does not conflict with the order status currently in the ORDSTAT table.
        Parameters:
        orderStatusAB - The OrderFulfillmentStatusAccessBean
        Returns:
        True If the new sequence is correct, otherwise false
        Throws:
        ECException
      • createOrderStatus

        public void createOrderStatus()
                               throws ECException
        This method creates a new entry in the ORDSTAT table based on the information that is received through the request properties. An ECException will be thrown if there are any problems with the update.
        Throws:
        ECException
      • doPostProcess

        public boolean doPostProcess(TypedProperty aRequestProperty)
                              throws ECException
        This method performs a verification check after the command executes. If getFinalizedPayment() returns true, It invokes doDOMPostProcesses() for DOM to reserve and finalize payments for order items those fulfillment statuses have been updated to D (deposited). It currently always returns true.
        Specified by:
        doPostProcess in interface OrderStatusCmd
        Parameters:
        aRequestProperty - com.ibm.commerce.datatype.TypedProperty
        Returns:
        This method currently always returns true.
        Throws:
        ECException
      • doDOMPreProcess

        public boolean doDOMPreProcess(TypedProperty aRequestProperty)
                                throws ECException
        Works with doDOMPostProcess(TypedProperty) to implement the following business logic. This implementation reserves and finalizes payments for order items those fulfillment statuses have been updated to D (deposited).

        Behavior:

        Parameters:
        aRequestProperty - com.ibm.commerce.datatype.TypedProperty
        Returns:
        This method currently always returns true.
        Throws:
        ECException
      • doDOMPostProcess

        public boolean doDOMPostProcess(TypedProperty aRequestProperty)
                                 throws ECException
        Works with doDOMPreProcess(TypedProperty) to implement the following business logic. This implementation reserves and finalizes payments for order items those fulfillment statuses have been updated to D (deposited).

        Behavior:

        Parameters:
        aRequestProperty - com.ibm.commerce.datatype.TypedProperty
        Returns:
        This method currently always returns true.
        Throws:
        ECException
      • doPreProcess

        public boolean doPreProcess(TypedProperty aRequestProperty)
                             throws ECException
        This method performs a verification check before the command executes. if getFinalizedPayment() returns true, It invokes doDOMPreProcesses() for DOM to reserve and finalize payments for order items those fulfillment statuses have been updated to D (deposited). It currently always returns true.
        Specified by:
        doPreProcess in interface OrderStatusCmd
        Parameters:
        aRequestProperty - com.ibm.commerce.datatype.TypedProperty
        Returns:
        This method currently always returns true.
        Throws:
        ECException
      • doProcess

        public boolean doProcess(TypedProperty aRequestProperty)
                          throws ECException
        This method performs the business logic for this command. It first determines whether this order is new or not. If so, it will add a new entry to the ORDSTAT table providing a WebSphere Commerce Server order does exist. Else, an existing entry in the ORDSTAT table is updated. This update requires that the request property sequence information does not conflict with the corresponding entry in the ORDSTAT table. Updating will depend on where versioning equals "TRUE". Versioning updates the entry and creates a new entry in the ORDSTAT table with the information found in the request properties. No versioning only consists of updating the entry. After the order status is created or updated, the order items in the status message will be updated.
        Specified by:
        doProcess in interface OrderStatusCmd
        Parameters:
        aRequestProperty - The request property
        Returns:
        boolean The method will return false or throw an ECException if there is a problem with the given information or the update, otherwise true.
        Throws:
        ECException
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method indicates whether the command is ready to execute.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        • False if the parents isReadyToCallExecute() fails.
        • False if order ID and merchant order number are both null.
        • Otherwise true.
      • getInventorySystem

        public java.lang.Short getInventorySystem()
                                           throws ECException
        Get the inventory system of the current online store.
        Returns:
        The inventory system of the current online store.
        Throws:
        ECException
      • performExecute

        public void performExecute()
                            throws ECException
        Performs a precondition check on the request properties. After a successful precondition, the business logic (doProcess) runs followed by a postcondition check to verify integrity is maintained. If any of the three steps fail, an ECException will be thrown.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • propertySet

        public void propertySet(OrderFulfillmentStatusAccessBean ab,
                                TypedProperty aProp)
                         throws ECException
        This method fills the OrderFulfillmentStatusAccessBean object with the values that are found in the request properties. If values found in the request properties conflict with the allowed values for the OrderFulfillmentStatusAccessBean, an ECException is thrown.
        Parameters:
        ab - The OrderFulfillmentStatusAccessBean
        aProp - The TypedProperty
        Throws:
        ECException
      • reset

        public void reset()
        This method resets the output properties to the values they had before calling the execute method. Any get methods no longer work but isReadyToCallExecute returns true. This provides a convenient and efficient way to reuse the same command instance with changes in some input properties or in the CommandTarget.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setRequestProperties

        public void setRequestProperties(TypedProperty aRequestProperties)
                                  throws ECException
        This method binds the parameters received by the request properties to variables that are used for determining the order to updated. Also, a validation check is performed on some of the given parameters and if this check fails, an ECException is thrown.
        Specified by:
        setRequestProperties in interface ControllerCommand
        Overrides:
        setRequestProperties in class ControllerCommandImpl
        Parameters:
        aRequestProperties - The request property
        Throws:
        ECException - Raised with _ERR_INVALID_ORDER_REFNUM whenever the order ID is not contained in the request property
      • updateOrder

        public void updateOrder(OrderAccessBean abOrder)
                         throws ECException
        This method updates the ORDSTAT table with the information given by the request properties.
        Parameters:
        abOrder - com.ibm.commerce.order.objects.OrderAccessBean
        Throws:
        ECException
      • validateParameters

        public void validateParameters()
                                throws ECException
        This method performs parameter checking. This method replaces checkParameters() in previous product releases. The default implementation of validateParameters() only checks if the order exists. It is the responsibility of the command writers to implement this method if they want to perform server side parameter checking.

        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECException - Raised if the order does not exist.
      • getIAccessVector

        public AccessVector getIAccessVector()
        This method returns the iAccessVector.
        Returns:
        AccessVector
      • getIMerchantOrderNumber

        public java.lang.String getIMerchantOrderNumber()
        This method returns the iMerchantOrderNumber.
        Returns:
        String
      • getIOrderId

        public java.lang.Long getIOrderId()
        This method returns the iOrderId.
        Returns:
        Long
      • getOsItems

        public java.util.Vector getOsItems()
        This method returns the osItems.
        Returns:
        Vector
      • getOsProp

        public TypedProperty getOsProp()
        This method returns the osProp.
        Returns:
        TypedProperty
      • isSyncWCSOrderStatusEnabled

        public static boolean isSyncWCSOrderStatusEnabled()
        Check whether the sync WCS order status flag is enabled in the configuration files. This property is configured in the order component configuration file wc-admin-component.xml. Add a new property syncWCSOrderStatus for the config grouping SyncOrder. The sample: <_config:extendedconfiguration> ........ <_config:configgrouping name="SyncOrder"> ........... <_config:property name="syncWCSOrderStatus" value="true"/> ........ If this property is set to true, the WCS order and order item status will be synchronized with the passed external order and order item status. If not specified, this property is defaulted to false.
        Returns:
        True if the flag is enabled. Otherwise, false.