com.ibm.commerce.orderquotation.commands

Class OrderItemSelectCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OrderItemSelectCmd, 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 OrderItemSelectCmdImpl
    extends ControllerCommandImpl
    implements OrderItemSelectCmd
    This is the default implementation of the OrderItemSelectCmd controller command.

    Parameter values

    quotationStoreId_i
    Specifies the stores for which quotation selection orders should be created or updated as specified by the orderItemId_i parameter.
    quotationContractId_i
    The default contract for the store indicated by quotationStoreId_i. The contracts for which quotation selection orders should be created or updated as specified by the orderItemId_i parameter. Ignored if quotationStoreId_i is not specified.
    orderId_i
    Used to resolve OrderItemId_i abbreviations specified by the orderItemId_i parameter.
    orderItemId_i
    The OrderItems to be copied to selection orders. OrderItems that are in quotation orders are copied to selection orders for their parent orders. They are in the same store and use the same contract as their quotation OrderQuotationRel objects. OrderItems that are not in quotation orders are copied to selection orders for themselves. They are in the stores and use the contracts specified by the quotationStoreId_i and quotationContractId_i parameters.
    quantity_i
    If the corresponding UOM_i is not specified, the quantity attribute of the corresponding OrderItem specified by OrderItemId_i. Otherwise, the actual quantity of the corresponding OrderItem specified by OrderItemId_i, converted to the unit of measure specified by the corresponding UOM. The quantities to be set in the shop cart's quotation selection orders for each of the items specified by orderItemId_i.
    UOM_i
    Specifies the units of measure for the quantities specified by quantity_i.
    outSelectionOrderQuotationRelIdName
    Specifies the name-value pairs that should be added to the redirection URL. The values of the added name-value pairs are the identifiers of the OrderQuotationRel objects. The objects are with relType `selection' whose quotation selection orders were created or updated.
    URL
    Specifies the redirection URL that is returned if the command completes successfully.

    Behavior:

    For each OrderItem specified by the orderItemId_i parameter:

    1. Determine the parent order and applicable store and contract pairs:
      1. If the order of the OrderItem is a child order for an OrderQuotationRel object. The parent order is indicated by the parentId attribute of the OrderQuotationRel object. And the applicable store and contract pair is indicated by the childStoreId and tradingAgreementId attributes.
      2. Otherwise, the parent order is the order of the OrderItem. And the applicable store and contract pairs are the store and contract pairs indicated by the quotationStoreId_i and quotationContractId_i parameters.
    2. If the parent order does not have status attribute P, I, E, W, or N, throw an exception and rollback.
    3. Determine the applicable selection OrderQuotationRel objects (one for each applicable store and contract pair). They are with relType `selection' where the childStoreId and tradingAgreementId attributes indicate one of the applicable store and contract pairs. And the parentId attribute indicates the parent order. If any of these selection OrderQuotationRel objects do not yet exist, create them.
    4. For each applicable selection OrderQuotationRel object:
      1. If the selection OrderQuotationRel object does not specify a child quotation order, create an order in the store indicated by the childStoreId attribute of the selection OrderQuotationRel object. When creating the order, copy order level information from the parent shop cart order. Set the order status attribute to P.
      2. Delete (reversing any backorders or allocated inventory) all OrderItems from the child Order indicated by the selection OrderQuotationRel object where:
        1. status attribute is P, I, E, W, or N and the fulfillmentStatus is INT.
        2. CatalogEntryId is the same as for the specified OrderItem.
        3. specifiedItemId is the same as for the specified OrderItem.
        4. correlationGroup is the same as for the specified OrderItem.
        5. supplierPartNumber is the same as for the specified OrderItem.

      For each OrderItem specified by the orderItemId_i parameter where the value of the quantity parameter is greater than zero:

      1. For each applicable selection OrderQuotationRel object:
        1. Copy the OrderItem to a new OrderItem in the quotation selection Order indicated by the selection OrderQuotationRel object:
        2. Set the quantity_i to the quantity specified by the quantity_i and UOM_i parameters. Re-calculate and set the neededQuantity.
      2. If the prepareFlags attribute of the OrderItem indicates `quotation'. And the storeId and tradingAgreementId attributes indicate the same Store and TradingAgreement as the childStoreId and tradingAgreementId attributes of the OrderQuotationRel object:
        1. Set the prepareFlags attribute to indicate `quotation'.
        2. Copy the tradingAgreementId attribute.
        3. Copy the basePrice and baseCurrency attributes if they are not null.
        4. Set the price attribute, converting it if necessary. If conversion is necessary:
          1. If the basePrice and baseCurrency are not null in the OrderItem, convert them to arrive at the price.
          2. If the basePrice and baseCurrency are null in the OrderItem, convert the price attribute to arrive at the price in the new OrderItem. And copy the price and currency to the basePrice and baseCurrency attributes in the new OrderItem.
          3. Set the OrderItem status attribute to be the same as its order status.
          4. Obtain values for other OrderItem attributes by either copying them from the specified OrderItem or accepting their default values, as appropriate. Attributes to copy include but are not limited to correlationGroup, supplierData, shipping address, estimatedAvailabilityTime, and shippingOffset. The supplierData, estimatedAvailabilityTime, and shippingOffset attributes should not be copied. Unless the storeId and tradingAgreementId attributes indicate the same Store and TradingAgreement as the childStoreId and tradingAgreementId attributes of the OrderQuotationRel object.
      3. Finally, redirect to the URL specified by the URL parameter, appending name value pairs as specified by the outSelectionOrderQuotationRelIdName parameter.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

      • OrderItemSelectCmdImpl

        public OrderItemSelectCmdImpl()
        Constructor for OrderItemSelectCmdImpl.