com.ibm.commerce.utf.commands

Class RFQCompleteCmdImpl

    • Field Detail

      • COPYRIGHT

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

        public java.lang.Long rfqId
        RFQ Id.
      • rfqOwner

        public java.lang.Long rfqOwner
        RFQ Owner.
      • nonUTFMessage

        public boolean nonUTFMessage
        Non UTF Message.
    • Constructor Detail

      • RFQCompleteCmdImpl

        public RFQCompleteCmdImpl()
    • Method Detail

      • checkRFQState

        public boolean checkRFQState(java.lang.Integer currentRFQState)
        Checks the state of the RFQ.

        Parameters:
        currentRFQState - The rfq state Integer value
      • createContracts

        public void createContracts()
                             throws ECException
        Creates a contract for each winning response.
        This method does the following:
        1. Retrieves the list of winning responses for the incoming RFQ.
        2. For each response, performs the following steps.
        3. Creates a contract with the same name as the RFQ Response.
        4. Creates Shipping Charge TC.
        5. Creates Return Charge TC.
        6. Creates Return Payment TC.
        7. Creates Custom Price List TC.
        8. Creates Participant entries for the seller and the buyer.

        Throws:
        ECException
      • createOrders

        public void createOrders()
                          throws ECException
        Creates an order for each winning response.
        This method does the following:
        1. Retrieves the list of winning responses for the incoming RFQ.
        2. For each response, performs the following steps.
        3. Add each item in the response to the order. The outcome is a single order with one or more order items.
        4. Calls the OrderPrepareCmd that allocates inventory and performs Fulfillment Center related checks.
        5. Calls the OrderProcessCmd that handles payment processing.

        Throws:
        ECException
      • doAcknowledgment

        public void doAcknowledgment()
        Composes and sends out the response
      • getErrorContent

        public java.util.Hashtable getErrorContent()
        Returns a hashtable of error codes.
        Returns:
        The hashtable containing error codes.
      • getRfqId

        public java.lang.Long getRfqId()
        Returns the RFQ identifier.
        Returns:
        The RFQ Id.
      • getRfqOwner

        public java.lang.Long getRfqOwner()
        Returns the RFQ owner's member Id.
        Returns:
        The member Id of the RFQ owner.
      • getShippingAddress

        public java.lang.String getShippingAddress(java.util.Vector shippingAddressList,
                                                   java.lang.String catentryId)
        Inspects the incoming list of shipping addresses to find the address corresponding to the incoming catalog entry.
        Parameters:
        shippingAddressList - A vector containing shipping information for catalog entries.
        catentryId - The catalog entry identifier.
        Returns:
        The shipping address for the incoming catalog entry.
      • getShippingMode

        public java.lang.String getShippingMode(java.util.Vector shippingModeList,
                                                java.lang.String catentryId)
        Inspects the incoming list of shipping modes to find the mode corresponding to the incoming catalog entry.
        Parameters:
        shippingModeList - A vector containing shippingmode information for catalog entries.
        catentryId - The catalog entry identifier.
        Returns:
        The shipping mode for the incoming catalog entry.
      • getToolXMLObject

        public java.util.Hashtable getToolXMLObject()
        Fetches the XML data prepared by the tools framework.
        Returns:
        A hashtable containing XML data from the tools framework.
      • getWinningResponseName

        public java.lang.String getWinningResponseName(java.lang.String responseId)
        Gets the name of the winning response.
        Parameters:
        responseId - The identifier of the winning response.
        Returns:
        The name of the winning response.
      • isNonUTFMessage

        public boolean isNonUTFMessage()
        Provides an indication whether the error message is an UTF message or not.
        Returns:
        true if the error message is an UTF message, false otherwise.
      • performExecute

        public void performExecute()
                            throws ECException
        Completes the RFQ by creating a contract or an order for each winning response.
        This method does the following:
        1. Calls createContracts() if the endresult s a Contract.
        2. Calls createOrders() if the endresult is an Order
        3. Sets the state of the RFQ to "Complete".
        4. Sets the completion time for the RFQ.
        5. Raises an UBF event to change the state of all the non-winning responses that are in evaluation for this RFQ
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
        See Also:
        ECCommand#performExecute()
      • setError

        public void setError(java.lang.String errorKey,
                             java.lang.String[] errorParams)
        Writes the errorcode into a hashtable
        Parameters:
        errorKey - The error code.
        errorParams - The error parameters.
      • setError

        public void setError(java.lang.String errorKey,
                             java.lang.String errorParams)
        Writes the errorcode into a hashtable
        Parameters:
        errorKey - The error code.
        errorParams - The error parameters.
      • setErrorContent

        public void setErrorContent(java.util.Hashtable newErrorContent)
        Assigns the incoming hashtable containing error codes and parameters to the errorContent member variable.
        Parameters:
        newErrorContent - The incoming hashtable containing error codes and parameters
      • setNonUTFMessage

        public void setNonUTFMessage(boolean newNonUTFMessage)
        Assigns the incoming boolean value to the nonUTFMessage member variable.
        Parameters:
        newNonUTFMessage - The incoming boolean value.
      • setRfqId

        public void setRfqId(java.lang.Long newRfqId)
        Assigns the incoming RFQ identifier to a member variable.
        Parameters:
        newRfqId - The RFQ identifier.
      • setRfqOwner

        public void setRfqOwner(java.lang.Long newRfqOwner)
        Assigns the incoming member identifier of the RFQ owner to a member variable.
        Parameters:
        newRfqOwner - The member Id of the RFQ owner.
      • setToolXMLObject

        public void setToolXMLObject(java.util.Hashtable newToolXMLObject)
        Sets a member variable to the incoming tools XML object.
        Parameters:
        newToolXMLObject - The XML object put together by tools framework.
      • validateParameters

        public void validateParameters()
                                throws ECException
        Validates the incoming parameters for this command.
        This method expects the following parameters :
        offering_id , the reference number of the RFQ that is to be completed

        This method does the following:
        1. Checks if an RFQ Id has been specified.
        2. Checks if the specified RFQ Id is valid.
        3. Checks if the RFQ is in the appropriate state.
        4. Calls checkContractParamters, if the endresult of this RFQ is a contract.
        5. Calls checkOrderParamters, if the endresult of this RFQ is an order.
        6. Throws an INVALID OFFERING ID Exception if the endresult is neither.
        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECException
        See Also:
        ECCommand#validateParameters()