com.ibm.commerce.rfq.commands

Class RFQToContractCreateCmdImpl

    • Field Detail

      • COPYRIGHT

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

      • RFQToContractCreateCmdImpl

        public RFQToContractCreateCmdImpl()
    • Method Detail

      • reset

        public void reset()
        Reset the command
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • 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
      • 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.
      • getAccountId

        public java.lang.Long getAccountId()
        Gets the accountId
        Returns:
        Returns a java.lang.Long
      • performExecute

        public void performExecute()
                            throws ECException
        Completes the RFQ by creating a contract for the winning response.
        This method does the following:
        1. Creates the contract
        2. if there is no more winning responses:
        3. 1) Sets the state of the RFQ to "Complete".
        4. 2) Sets the completion time for the RFQ.
        5. 3) 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()
      • setRequestProperties

        public void setRequestProperties(TypedProperty requestProperties)
                                  throws ECException
        Get the rfqId, responseId, billTo parameters from the request.
        Specified by:
        setRequestProperties in interface ControllerCommand
        Overrides:
        setRequestProperties in class ControllerCommandImpl
        Parameters:
        requestProperties - TypedProperty containing the input parameters
        Throws:
        ECException - This exception can be raised with any of the following messages _ERR_RFQ_INVALID_REQUESTID, _ERR_RFQ_INVALID_RESPONSEID, _ERR_RFQ_NO_SHIPPING_CHARGE.
        See Also:
        ControllerCmd#setRequestProperties(TypedProperty)
      • 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.
      • setAccountId

        public void setAccountId(java.lang.Long newAccId)
        Sets the accountId
        Parameters:
        newAccId - The accountId to set
      • 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()
      • getResId

        public java.lang.Long getResId()
        Gets the responseId
        Returns:
        Returns a java.lang.Long
      • setResId

        public void setResId(java.lang.Long newResponseId)
        Sets the resId
        Parameters:
        newResponseId - The responseId to set
      • getEnforceMinQuantity

        public java.lang.String getEnforceMinQuantity()
        Gets the enforce minimum quantity setting
        Returns:
        Returns a String
      • setEnforceMinQuantity

        public void setEnforceMinQuantity(java.lang.String newEnforceMinQuantity)
        Sets the enforce minimum quantity setting
        Parameters:
        newEnforceMinQuantity - The enforceMinQuantity to set
      • getShipChargeType

        public java.lang.String getShipChargeType()
        Gets the shippingChargeType
        Returns:
        Returns a String
      • setShipChargeType

        public void setShipChargeType(java.lang.String newShippingChargeType)
        Sets the shippingChargeType
        Parameters:
        newShippingChargeType - The shippingChargeType to set
      • getReturnChargePolicy

        public java.lang.String getReturnChargePolicy()
        Gets the rtnChargePolicy
        Returns:
        Returns a String
      • setReturnChargePolicy

        public void setReturnChargePolicy(java.lang.String newRtnChargePolicy)
        Sets the rtnChargePolicy
        Parameters:
        newRtnChargePolicy - The returnChargePolicy to set
      • getReturnApprovalPolicy

        public java.lang.String getReturnApprovalPolicy()
        Gets the rtnApprovalPolicy
        Returns:
        Returns a String
      • setReturnApprovalPolicy

        public void setReturnApprovalPolicy(java.lang.String newRtnApprovalPolicy)
        Sets the returnApprovalPolicy
        Parameters:
        newRtnApprovalPolicy - The returnApprovalPolicy to set
      • getReturnPaymentPolicies

        public java.lang.String[] getReturnPaymentPolicies()
        Returns the return payment policies.
        Returns:
        The return payment policies.
      • setReturnPaymentPolicies

        public void setReturnPaymentPolicies(java.lang.String[] newReturnPaymentPolicies)
        Sets the return payment policies.
        Parameters:
        newReturnPaymentPolicies - The return payment policies.