com.ibm.commerce.orderitems.commands

Class InventoryAllocationCheckCmdImpl

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

    Behaviour:

    It redirects to a specified URL based on the status of the order items in specified orders. And then categorize order items into lists for display.
    • For each enumeration group i in ascending order:
      • Resolve order items specified by the orderItem1_i and orderItem2_i parameters for orders specified by the orderId parameter. Resolved values are added to the redirection URL as name-value pairs. The name-value pairs are with the names resolvedOrderItem1_i for items in orderItem1_i and resolvedOrderItem2_i for items in orderItem2_i.
      • Redirect to the URL specified by URL_i (if provided) if all of the operations in the enumeration group are true. An operation is true if one of the following conditions is true:
        • Operation specified by the operation_i is 'subset' and order items specified by the orderItem1_i are subsets of the order items specified by the orderItem2_i.
        • Operation specified by the operation_i is 'equal' and sets of items specified by the orderItem1_i and orderItem2_i are equal.
        • Operation specified by the operation_i is 'unionEmpty' and the union of sets of items specified by the orderItem1_i and orderItem2_i parameters is empty.
        • Operation specified by the operation_i is 'unionNotEmpty' and the union of sets of items specified by the orderItem1_i and orderItem2_i parameters is not empty.
    • Redirect to the URL specified by the URL parameter if none of the operations processed in step two. This step resulted in a redirection to one of the URLs specified by the URL_i parameters.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

      • InventoryAllocationCheckCmdImpl

        public InventoryAllocationCheckCmdImpl()
    • Method Detail

      • setOrderId

        public void setOrderId(java.lang.String[] aOrder_id)
        This method sets the order ID parameters (optional). If it is not set, the current pending order ID is used.
        Parameters:
        aOrder_id - an array of order IDs.
      • getOrderId

        public java.lang.String[] getOrderId()
        This method returns the list of orderIds.
        Returns:
        String[] array of order ids.
      • performExecute

        public void performExecute()
                            throws ECException
        This method executes the main business logic of this command. For each enumeration group <i> in ascending order:
      • Resolve order items specified by the orderItem1_<i> and orderItem2_<i> parameters for orders specified by the orderId parameter. Resolved values are added to the redirection URL as name-value pairs. The name value pairs are with the names resolvedOrderItem1_<i> for items in orderItem1_<i> and resolvedOrderItem2_<i> for items in orderItem2_<i>.
      • Redirect to the URL specified by URL_<i> (if provided) if all of the operations in the enumeration group are true. An operation is true if one of the following conditions is true:
      • operation specified by the operation_<i> is 'subset' and order items specified by the orderItem1_<i> are subsets of the order items specified by the orderItem2_<i>.
      • operation specified by the operation_<i> is 'equal' and sets of items specified by the orderItem1_<i> and orderItem2_<i> are equal.
      • operation specified by the operation_<i> is 'unionEmpty' and the union of sets of items specified by the orderItem1_<i> and orderItem2_<i> parameters is empty.
      • operation specified by the operation_<i> is 'unionNotEmpty' and the union of sets of items specified by the orderItem1_<i> and orderItem2_<i> parameters is not empty.
      • Redirect to the URL specified by the URL parameter if none of the operations processed in step two. This step resulted in a redirection to one of the URLs specified by the URL_<i> parameters.
Specified by:
performExecute in interface ECCommand
Specified by:
performExecute in interface com.ibm.websphere.command.TargetableCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - if any exceptions occurred during execution.
  • getUrl

    public java.lang.String getUrl()
    This method gets the URL taken if none of the specified enumeration groups match. Or none of the matching enumeration groups have corresponding URL_i parameters.
    Returns:
    the URL.
  • setUrl

    public void setUrl(java.lang.String string)
    This method sets the URL taken if none of the specified enumeration groups match. Or none of the matching enumeration groups have corresponding URL_i parameters.
    Parameters:
    string - the URL.
  • getResolvedOrderIds

    public java.lang.String[] getResolvedOrderIds()
    This method gets the list of resolved order IDs.
    Returns:
    String[] an array of resolved order IDs.