com.ibm.commerce.order.commands

Interface CheckOrderAttributesCmd

  • All Superinterfaces:
    com.ibm.websphere.command.CacheableCommand, com.ibm.commerce.command.CacheableECCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, ECCommand, java.io.Serializable, com.ibm.websphere.command.TargetableCommand, TaskCommand
    All Known Implementing Classes:
    CheckOrderAttributesCmdImpl


    public interface CheckOrderAttributesCmd
    extends TaskCommand
    This command check order's attributes. for an order.
    • Field Detail

      • COPYRIGHT

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

        static final java.lang.String NAME
        The name of the Command Interface class.
        See Also:
        Constant Field Values
      • defaultCommandClassName

        static final java.lang.String defaultCommandClassName
        The default implementation class.
        See Also:
        Constant Field Values
    • Method Detail

      • setOrderAccessBean

        void setOrderAccessBean(OrderAccessBean orderAB)
        set order access bean you want to check
        Parameters:
        orderAB - OrderAccessBean
      • setOrderItemAccessBean

        void setOrderItemAccessBean(OrderItemAccessBean[] orderItemABs)
        set order item access beans you want to check
        Parameters:
        orderItemABs - OrderAccessBean
      • setAttributes

        void setAttributes(java.lang.String[] attributeNames,
                           java.lang.String[] attributeValues)
        set attributes you want to check. If attributeValues is null, return order items which contain any one of attribute names and attributes' values. If attributeValues is not null, return order items which contain attributeNames[i] and the attribute value equal to the value of attributeValues[i]. The following sample code demonstrates how to set attributes:
              String[] attributeNames  = new String[] ({"attributeName1",  "attributeName2" });
              String[] attributeValues = new String[] ({"attributeValue1", "attributeValue2"});
         
        attributeValues can be null.
        Parameters:
        attributeNames -
        attributeValues -
      • getOrderItems

        java.util.Map getOrderItems()
        Returns:
        Map with below format The following sample code demonstrates how to resolve the result:
          Map result = checkOrderAttributes.getOrderItems();
          String[] orderItemIds = (String[]) result.get("orderItemIds");
          Map[]    attributes   = (Map[])    result.get("attributeNames");
          for (int i=0; i<orderItemIds.length; i++) {
                String orderItem=orderItemIds[i];
                Map attributesArray = attributes[i];
                if (attributesArray.containsKey("attributeName1")){
                        String attributeValue1 = (String) attributesArray.get("attributeName1");
                }
          }