com.ibm.commerce.marketing.commands.elements

Class ConditionUtil

  • java.lang.Object
    • com.ibm.commerce.marketing.commands.elements.ConditionUtil


  • public class ConditionUtil
    extends java.lang.Object
    This class provides utility methods that are used to do Java native type comparisons.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static boolean checkEqualDate(java.lang.String dateValue1, java.sql.Timestamp orderDate)
      This method checks if two dates are equal.
      static boolean checkOrderForPromotion(java.lang.String orderId, java.lang.String promotionId, java.lang.String dateOperator1, java.lang.String dateValue1, java.lang.String dateOperator2, java.lang.String dateValue2)
      This method checks the order to determine if the specified promotion was used.
      static boolean checkShoppingCartForPromotion(java.lang.String promotionId, java.lang.Long memberId, java.lang.Integer storeId)
      This method checks the current shopping cart for the customer to determine if the specified promotion is currently applied.
      static boolean evaluate2Strings(java.lang.String value1, java.lang.String value2, java.lang.String operator, java.lang.String value3)
      This method will compare two string values to a third using the specified operator.
      static boolean evaluateBigDecimal(java.math.BigDecimal value1, java.lang.String operator, java.math.BigDecimal value2)
      This method will compare two big decimal values using the specified operator.
      static boolean evaluateDate(java.lang.String value1, java.lang.String operator, java.lang.String value2)
      This method will compare two date values using the specified operator.
      static boolean evaluateDouble(java.lang.Double doubleValue1, java.lang.String operator, java.lang.Double doubleValue2)
      This method will compare two double values using the specified operator.
      static boolean evaluateDurationInDays(java.sql.Timestamp timestamp, java.lang.String operator, java.lang.Integer value)
      This method will compare a timestamp to an integer value using the specified operator.
      static boolean evaluateInteger(java.lang.Integer value1, java.lang.String operator, java.lang.Integer value2)
      This method will compare two integer values using the specified operator.
      static boolean evaluateString(java.lang.String value1, java.lang.String operator, java.lang.String value2)
      This method will compare two string values using the specified operator.
      static boolean evaluateStringIgnoreCase(java.lang.String value1, java.lang.String operator, java.lang.String value2)
      This method will compare two string values using the specified operator.
      static java.util.List getChildCatentries(java.lang.Integer storeId, java.lang.String catentryId)
      This method gets the child catalog entries (items) of the specified catalog entry (product).
      static java.lang.String getDateClause(java.lang.String type, java.lang.String daysOperator, java.lang.String daysValue, java.lang.String dateOperator1, java.lang.String dateValue1, java.lang.String dateOperator2, java.lang.String dateValue2)
      This method gets the SQL clause for checking dates in an order or an orderitem.
      static java.sql.PreparedStatement getOrderStatementDateParameters(java.sql.PreparedStatement statement, int index, java.lang.String daysOperator, java.lang.String daysValue, java.lang.String dateOperator1, java.lang.String dateValue1, java.lang.String dateOperator2, java.lang.String dateValue2)
      This method sets the date parameters into a SQL prepared statement.
      static java.util.List getOwnersOfAbandonedShoppingCarts(java.lang.Integer storeId, boolean includeGuestShoppers, java.lang.String afterDate, java.lang.String beforeDate)
      This method gets the member IDs and personalization IDs for customers who have abandoned their shopping cart.
      static OrderInfo[] getPurchaseHistoryOrderItems(java.lang.Integer storeId, java.lang.Long[] memberIds, java.lang.String daysOperator, java.lang.String daysValue, java.lang.String dateOperator1, java.lang.String dateValue1, java.lang.String dateOperator2, java.lang.String dateValue2)
      This method gets the order items in a set of completed orders for a customer.
      static OrderInfo[] getPurchaseHistoryOrders(java.lang.Integer storeId, java.lang.Long[] memberIds, java.lang.String daysOperator, java.lang.String daysValue, java.lang.String dateOperator1, java.lang.String dateValue1, java.lang.String dateOperator2, java.lang.String dateValue2)
      This method gets the set of completed orders for a customer.
      static OrderInfo[] getShoppingCartOrderItems(java.lang.Integer storeId, java.lang.Long memberId, java.lang.String daysOperator, java.lang.String daysValue, java.lang.String dateOperator1, java.lang.String dateValue1, java.lang.String dateOperator2, java.lang.String dateValue2)
      This method gets the order items in a shopping cart for a customer.
      static java.math.BigDecimal getTotalAdjustmentForOrderByCalculationUsageId(java.lang.Long orderId, java.lang.Integer calculationUsageId)
      This method gets the adjustments made to an order associated with a particular adjustment type.
      static java.math.BigDecimal getTotalAdjustmentForOrderItemByCalculationUsageId(java.lang.Long orderItemId, java.lang.Integer calculationUsageId)
      This method gets the adjustments made to an order item associated with a particular adjustment type.
      static java.util.List getUsersByBirthday(java.lang.Integer storeId, java.lang.String targetMM, java.lang.String targetDD)
      This method gets the member IDs and personalization IDs for customers whose birthday is at the specific month and day.
      static java.math.BigDecimal toBigDecimal(java.lang.String value)
      Converts a String value to BigDecimal.
      static java.lang.Double toDouble(java.lang.String value)
      Converts a String value to Double.
      static java.lang.Integer toInteger(java.lang.String value)
      Converts a String value to Integer.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String CLASSNAME
        The name of this class.
        See Also:
        Constant Field Values
      • OPERATOR_EQUAL_TO

        public static final java.lang.String OPERATOR_EQUAL_TO
        Equal to operator - "=".
        See Also:
        Constant Field Values
      • OPERATOR_NOT_EQUAL_TO

        public static final java.lang.String OPERATOR_NOT_EQUAL_TO
        Not equal to operator - "!=".
        See Also:
        Constant Field Values
      • OPERATOR_GREATER_THAN

        public static final java.lang.String OPERATOR_GREATER_THAN
        Greater than operator - ">".
        See Also:
        Constant Field Values
      • OPERATOR_LESS_THAN

        public static final java.lang.String OPERATOR_LESS_THAN
        Less than operator - "<".
        See Also:
        Constant Field Values
      • OPERATOR_GREATER_THAN_OR_EQUAL_TO

        public static final java.lang.String OPERATOR_GREATER_THAN_OR_EQUAL_TO
        Greater than or equal to operator - ">=".
        See Also:
        Constant Field Values
      • OPERATOR_LESS_THAN_OR_EQUAL_TO

        public static final java.lang.String OPERATOR_LESS_THAN_OR_EQUAL_TO
        Less than or equal to operator - "<=".
        See Also:
        Constant Field Values
      • OPERATOR_STARTS_WITH

        public static final java.lang.String OPERATOR_STARTS_WITH
        Starts with operator - "startsWith".
        See Also:
        Constant Field Values
      • OPERATOR_DOES_NOT_START_WITH

        public static final java.lang.String OPERATOR_DOES_NOT_START_WITH
        Does not start with operator - "doesNotStartWith".
        See Also:
        Constant Field Values
      • OPERATOR_ENDS_WITH

        public static final java.lang.String OPERATOR_ENDS_WITH
        Ends with operator - "endsWith".
        See Also:
        Constant Field Values
      • OPERATOR_DOES_NOT_END_WITH

        public static final java.lang.String OPERATOR_DOES_NOT_END_WITH
        Does not end with operator - "doesNotEndWith".
        See Also:
        Constant Field Values
      • OPERATOR_CONTAINS

        public static final java.lang.String OPERATOR_CONTAINS
        Contains operator - "contains".
        See Also:
        Constant Field Values
      • OPERATOR_DOES_NOT_CONTAIN

        public static final java.lang.String OPERATOR_DOES_NOT_CONTAIN
        Does not contain - "doesNotContain".
        See Also:
        Constant Field Values
      • PREVIOUS_ORDERS

        public static final java.lang.String PREVIOUS_ORDERS
        Check the specified number of previous orders - "previousOrders".
        See Also:
        Constant Field Values
    • Method Detail

      • evaluateString

        public static boolean evaluateString(java.lang.String value1,
                                             java.lang.String operator,
                                             java.lang.String value2)
        This method will compare two string values using the specified operator.
        Parameters:
        value1 - a string value
        operator - the operator used to compare the string values. The following values are supported:
        OPERATOR_EQUAL_TO
        OPERATOR_NOT_EQUAL_TO
        OPERATOR_STARTS_WITH
        OPERATOR_DOES_NOT_START_WITH
        OPERATOR_ENDS_WITH
        OPERATOR_DOES_NOT_END_WITH
        OPERATOR_CONTAINS
        OPERATOR_DOES_NOT_CONTAIN
        value2 - a string value
        Returns:
        true if the expression evaluates to true.
      • evaluateStringIgnoreCase

        public static boolean evaluateStringIgnoreCase(java.lang.String value1,
                                                       java.lang.String operator,
                                                       java.lang.String value2)
        This method will compare two string values using the specified operator. All operations will ignore the case of the text.
        Parameters:
        value1 - a string value
        operator - the operator used to compare the string values. The following values are supported:
        OPERATOR_EQUAL_TO
        OPERATOR_NOT_EQUAL_TO
        OPERATOR_STARTS_WITH
        OPERATOR_DOES_NOT_START_WITH
        OPERATOR_ENDS_WITH
        OPERATOR_DOES_NOT_END_WITH
        OPERATOR_CONTAINS
        OPERATOR_DOES_NOT_CONTAIN
        value2 - a string value
        Returns:
        true if the expression evaluates to true.
      • evaluate2Strings

        public static boolean evaluate2Strings(java.lang.String value1,
                                               java.lang.String value2,
                                               java.lang.String operator,
                                               java.lang.String value3)
        This method will compare two string values to a third using the specified operator. If either of the first two strings results in a true condition, then the result will be true.
        Parameters:
        value1 - a string value
        value2 - a string value
        operator - the operator used to compare the string values. The following values are supported:
        OPERATOR_EQUAL_TO
        OPERATOR_NOT_EQUAL_TO
        OPERATOR_STARTS_WITH
        OPERATOR_DOES_NOT_START_WITH
        OPERATOR_ENDS_WITH
        OPERATOR_DOES_NOT_END_WITH
        OPERATOR_CONTAINS
        OPERATOR_DOES_NOT_CONTAIN
        value3 - a string value
        Returns:
        true if the expression evaluates to true.
      • evaluateInteger

        public static boolean evaluateInteger(java.lang.Integer value1,
                                              java.lang.String operator,
                                              java.lang.Integer value2)
        This method will compare two integer values using the specified operator.
        Parameters:
        value1 - an integer value
        operator - the operator used to compare the integer values. The following values are supported:
        OPERATOR_EQUAL_TO
        OPERATOR_NOT_EQUAL_TO
        OPERATOR_LESS_THAN
        OPERATOR_GREATER_THAN
        OPERATOR_LESS_THAN_OR_EQUAL_TO
        OPERATOR_GREATER_THAN_OR_EQUAL_TO
        value2 - an integer value
        Returns:
        true if the expression evaluates to true.
      • evaluateDouble

        public static boolean evaluateDouble(java.lang.Double doubleValue1,
                                             java.lang.String operator,
                                             java.lang.Double doubleValue2)
        This method will compare two double values using the specified operator.
        Parameters:
        doubleValue1 - an double value
        operator - the operator used to compare the double values. The following values are supported:
        OPERATOR_EQUAL_TO
        OPERATOR_NOT_EQUAL_TO
        OPERATOR_LESS_THAN
        OPERATOR_GREATER_THAN
        OPERATOR_LESS_THAN_OR_EQUAL_TO
        OPERATOR_GREATER_THAN_OR_EQUAL_TO
        doubleValue2 - an double value
        Returns:
        true if the expression evaluates to true.
      • evaluateBigDecimal

        public static boolean evaluateBigDecimal(java.math.BigDecimal value1,
                                                 java.lang.String operator,
                                                 java.math.BigDecimal value2)
        This method will compare two big decimal values using the specified operator.
        Parameters:
        value1 - a big decimal value
        operator - the operator used to compare the big decimal values. The following values are supported:
        OPERATOR_EQUAL_TO
        OPERATOR_NOT_EQUAL_TO
        OPERATOR_LESS_THAN
        OPERATOR_GREATER_THAN
        OPERATOR_LESS_THAN_OR_EQUAL_TO
        OPERATOR_GREATER_THAN_OR_EQUAL_TO
        value2 - a big decimal value
        Returns:
        true if the expression evaluates to true.
      • evaluateDurationInDays

        public static boolean evaluateDurationInDays(java.sql.Timestamp timestamp,
                                                     java.lang.String operator,
                                                     java.lang.Integer value)
        This method will compare a timestamp to an integer value using the specified operator. The integer value represents the number of days from the current time.
        Parameters:
        timestamp - a timestamp
        operator - the operator used to compare the string values. The following values are supported:
        OPERATOR_EQUAL_TO
        OPERATOR_NOT_EQUAL_TO
        OPERATOR_LESS_THAN
        OPERATOR_GREATER_THAN
        OPERATOR_LESS_THAN_OR_EQUAL_TO
        OPERATOR_GREATER_THAN_OR_EQUAL_TO
        value - days since the current time
        Returns:
        true if the expression evaluates to true.
      • evaluateDate

        public static boolean evaluateDate(java.lang.String value1,
                                           java.lang.String operator,
                                           java.lang.String value2)
        This method will compare two date values using the specified operator.
        Parameters:
        value1 - a date value in the form yyyy-mm-dd
        operator - the operator used to compare the date values. The following values are supported:
        OPERATOR_EQUAL_TO
        OPERATOR_NOT_EQUAL_TO
        OPERATOR_LESS_THAN
        OPERATOR_GREATER_THAN
        OPERATOR_LESS_THAN_OR_EQUAL_TO
        OPERATOR_GREATER_THAN_OR_EQUAL_TO
        value2 - a date value in the form yyyy-mm-dd
        Returns:
        true if the expression evaluates to true.
      • toBigDecimal

        public static java.math.BigDecimal toBigDecimal(java.lang.String value)
        Converts a String value to BigDecimal.
        Parameters:
        value - The value to convert to a BigDecimal.
        Returns:
        A BigDecimal object or null.
      • toInteger

        public static java.lang.Integer toInteger(java.lang.String value)
        Converts a String value to Integer.
        Parameters:
        value - The value to convert to an Integer.
        Returns:
        An Integer object or null.
      • toDouble

        public static java.lang.Double toDouble(java.lang.String value)
        Converts a String value to Double.
        Parameters:
        value - The value to convert to a Double.
        Returns:
        A Double object or null.
      • checkEqualDate

        public static boolean checkEqualDate(java.lang.String dateValue1,
                                             java.sql.Timestamp orderDate)
        This method checks if two dates are equal. The dates are equal if they are on the same date (day, month, and year), ignoring any specified times (hour, minutes, seconds).
        Parameters:
        dateValue1 - The first date.
        orderDate - The date of the order.
        Returns:
        This method returns true if the two dates are on the same date.
      • getDateClause

        public static java.lang.String getDateClause(java.lang.String type,
                                                     java.lang.String daysOperator,
                                                     java.lang.String daysValue,
                                                     java.lang.String dateOperator1,
                                                     java.lang.String dateValue1,
                                                     java.lang.String dateOperator2,
                                                     java.lang.String dateValue2)
        This method gets the SQL clause for checking dates in an order or an orderitem. It will create the clauses for the one or for the two dates provided. The recommendation is to add this to the end of the SQL statement to avoid issues with the number of (index) parameter markers when calling getOrderStatementDateParameters to create the PreparedStatement.
        Parameters:
        type - The type of query being done. If this value is "order", then the SQL clause will use "AND ORDERS.TIMEPLACED". If this value is "orderitem", then the SQL clause will use "AND ORDERITEMS.LASTCREATE". If both of these clauses are not appropriate for the query, then use this parameter to pass in the appropriate date clause. For example, for interest item list, the type parameter can be " AND iitem.LASTUPDATE ". If passing in a date clause, then the clause should include a leading and trailing space.
        daysOperator - The operator for checking if the order items are within/prior the specified number of days. There is a special case for the purchase history target to specify that only a specific number of previous orders should be checked. In that scenario the daysOperator is equal to previousOrders, and this method will do nothing.
        daysValue - The number of days for checking if the order items are within/prior the specified number of days.
        dateOperator1 - The operator for checking if the order items are within the specified date.
        dateValue1 - The date value for checking if the order items are within the specified date.
        dateOperator2 - The operator for checking if the order items are within the specified date.
        dateValue2 - The date value for checking if the order items are within the specified date.
        Returns:
        This method returns the SQL clause for checking dates in an order or an orderitem.
      • getOrderStatementDateParameters

        public static java.sql.PreparedStatement getOrderStatementDateParameters(java.sql.PreparedStatement statement,
                                                                                 int index,
                                                                                 java.lang.String daysOperator,
                                                                                 java.lang.String daysValue,
                                                                                 java.lang.String dateOperator1,
                                                                                 java.lang.String dateValue1,
                                                                                 java.lang.String dateOperator2,
                                                                                 java.lang.String dateValue2)
                                                                          throws java.sql.SQLException
        This method sets the date parameters into a SQL prepared statement. It will set the appropriate parameters for the date clause created by the getDateClause method.
        Parameters:
        statement - The SQL prepared statement to modify.
        index - The index of the next parameter to replace in the prepared statement.
        daysOperator - The operator for checking if the order items are within/prior the specified number of days. There is a special case for the purchase history target to specify that only a specific number of previous orders should be checked. In that scenario the daysOperator is equal to previousOrders, and this method will do nothing.
        daysValue - The number of days for checking if the order items are within/prior the specified number of days.
        dateOperator1 - The operator for checking if the order items are within the specified date.
        dateValue1 - The date value for checking if the order items are within the specified date.
        dateOperator2 - The operator for checking if the order items are within the specified date.
        dateValue2 - The date value for checking if the order items are within the specified date.
        Returns:
        This method returns the SQL prepared statement set with the date parameters.
        Throws:
        java.sql.SQLException
      • getShoppingCartOrderItems

        public static OrderInfo[] getShoppingCartOrderItems(java.lang.Integer storeId,
                                                            java.lang.Long memberId,
                                                            java.lang.String daysOperator,
                                                            java.lang.String daysValue,
                                                            java.lang.String dateOperator1,
                                                            java.lang.String dateValue1,
                                                            java.lang.String dateOperator2,
                                                            java.lang.String dateValue2)
                                                     throws java.lang.Exception
        This method gets the order items in a shopping cart for a customer.
        Parameters:
        storeId - The unique ID of the store.
        memberId - The member ID for which to retrieve the shopping cart order items.
        daysOperator - The operator for checking if the shopping cart order items are within/prior the specified number of days.
        daysValue - The number of days for checking if the shopping cart order items are within/prior the specified number of days.
        dateOperator1 - The operator for checking if the shopping cart order items are within the specified date.
        dateValue1 - The date value for checking if the shopping cart order items are within the specified date.
        dateOperator2 - The operator for checking if the shopping cart order items are within the specified date.
        dateValue2 - The date value for checking if the shopping cart order items are within the specified date.
        Returns:
        This method returns the shopping cart order items for a customer matching the specified date criteria.
        Throws:
        java.lang.Exception
      • getUsersByBirthday

        public static java.util.List getUsersByBirthday(java.lang.Integer storeId,
                                                        java.lang.String targetMM,
                                                        java.lang.String targetDD)
        This method gets the member IDs and personalization IDs for customers whose birthday is at the specific month and day.
        Parameters:
        storeId - The unique ID of the store.
        targetMM - The string for the specific month in MM format.
        targetDD - The string for the specific day in DD format.
        Returns:
        This method returns the list with the customer information. Every element in the list is a child-list; in the child-list, the 1st element is the customer's member ID, and the 2nd element is the customer's personalization ID.
      • getOwnersOfAbandonedShoppingCarts

        public static java.util.List getOwnersOfAbandonedShoppingCarts(java.lang.Integer storeId,
                                                                       boolean includeGuestShoppers,
                                                                       java.lang.String afterDate,
                                                                       java.lang.String beforeDate)
                                                                throws java.lang.Exception
        This method gets the member IDs and personalization IDs for customers who have abandoned their shopping cart. An abandoned shopping cart is one whose last update date is before the date specified in the beforeDate parameter. The afterDate parameter restricts the query to find carts whose last update date is between afterDate and before beforeDate.
        Parameters:
        storeId - The unique ID of the store.
        includeGuestShoppers - Should this method return carts abandoned by guest shoppers.
        afterDate - The oldest value allowed for the shopping cart last update date.
        beforeDate - The most recent value allowed for the shopping cart last update date.
        Returns:
        This method returns the vector with the customer information. Every element in the vector is a child-vector; in the child-vector, the 1st element is the customer's member ID, and the 2nd element is the customer's personalization ID.
        Throws:
        java.lang.Exception
      • getPurchaseHistoryOrderItems

        public static OrderInfo[] getPurchaseHistoryOrderItems(java.lang.Integer storeId,
                                                               java.lang.Long[] memberIds,
                                                               java.lang.String daysOperator,
                                                               java.lang.String daysValue,
                                                               java.lang.String dateOperator1,
                                                               java.lang.String dateValue1,
                                                               java.lang.String dateOperator2,
                                                               java.lang.String dateValue2)
                                                        throws java.lang.Exception
        This method gets the order items in a set of completed orders for a customer.
        Parameters:
        storeId - The unique ID of the store.
        memberIds - The member IDs for which to retrieve the order items.
        daysOperator - The operator for checking if the order items are within/prior the specified number of days. There is a special case for the purchase history target to specify that only a specific number of previous orders should be checked. In that scenario the daysOperator is equal to previousOrders, and daysValue is the number of previous orders to consider. The other date parameters are not valid when previousOrders is used.
        daysValue - The number of days for checking if the order items are within/prior the specified number of days.
        dateOperator1 - The operator for checking if the order items are within the specified date.
        dateValue1 - The date value for checking if the order items are within the specified date.
        dateOperator2 - The operator for checking if the order items are within the specified date.
        dateValue2 - The date value for checking if the order items are within the specified date.
        Returns:
        This method returns the order items for a customer matching the specified date criteria.
        Throws:
        java.lang.Exception
      • getPurchaseHistoryOrders

        public static OrderInfo[] getPurchaseHistoryOrders(java.lang.Integer storeId,
                                                           java.lang.Long[] memberIds,
                                                           java.lang.String daysOperator,
                                                           java.lang.String daysValue,
                                                           java.lang.String dateOperator1,
                                                           java.lang.String dateValue1,
                                                           java.lang.String dateOperator2,
                                                           java.lang.String dateValue2)
                                                    throws java.lang.Exception
        This method gets the set of completed orders for a customer.
        Parameters:
        storeId - The unique ID of the store.
        memberIds - The member IDs for which to retrieve the orders.
        daysOperator - The operator for checking if the order is within/prior the specified number of days. There is a special case for the purchase history target to specify that only a specific number of previous orders should be checked. In that scenario the daysOperator is equal to previousOrders, and daysValue is the number of previous orders to consider. The other date parameters are not valid when previousOrders is used.
        daysValue - The number of days for checking if the order is within/prior the specified number of days.
        dateOperator1 - The operator for checking if the order is within the specified date.
        dateValue1 - The date value for checking if the order is within the specified date.
        dateOperator2 - The operator for checking if the order is within the specified date.
        dateValue2 - The date value for checking if the order is within the specified date.
        Returns:
        This method returns the orders for a customer matching the specified date criteria.
        Throws:
        java.lang.Exception
      • getChildCatentries

        public static java.util.List getChildCatentries(java.lang.Integer storeId,
                                                        java.lang.String catentryId)
                                                 throws java.lang.Exception
        This method gets the child catalog entries (items) of the specified catalog entry (product).
        Parameters:
        storeId - The unique ID of the store.
        catentryId - The unique ID of the catalog entry for which to find the child catalog entries.
        Returns:
        This method returns a List of strings with the child catalog entry IDs.
        Throws:
        java.lang.Exception
      • getTotalAdjustmentForOrderItemByCalculationUsageId

        public static java.math.BigDecimal getTotalAdjustmentForOrderItemByCalculationUsageId(java.lang.Long orderItemId,
                                                                                              java.lang.Integer calculationUsageId)
        This method gets the adjustments made to an order item associated with a particular adjustment type.
        Parameters:
        orderItemId - The ID of the order item.
        calculationUsageId - The ID of the adjustment type.
        Returns:
        This method returns the adjustments made to the order item of the specified type. If no adjustments were made, then 0 is returned.
      • getTotalAdjustmentForOrderByCalculationUsageId

        public static java.math.BigDecimal getTotalAdjustmentForOrderByCalculationUsageId(java.lang.Long orderId,
                                                                                          java.lang.Integer calculationUsageId)
        This method gets the adjustments made to an order associated with a particular adjustment type.
        Parameters:
        orderId - The ID of the order.
        calculationUsageId - The ID of the adjustment type.
        Returns:
        This method returns the adjustments made to the order of the specified type. If no adjustments were made, then 0 is returned.
      • checkOrderForPromotion

        public static boolean checkOrderForPromotion(java.lang.String orderId,
                                                     java.lang.String promotionId,
                                                     java.lang.String dateOperator1,
                                                     java.lang.String dateValue1,
                                                     java.lang.String dateOperator2,
                                                     java.lang.String dateValue2)
                                              throws java.lang.Exception
        This method checks the order to determine if the specified promotion was used.
        Parameters:
        orderId - The ID of the order.
        promotionId - The promotion ID specified in the trigger.
        dateOperator1 - The operator for checking if the order items are within the specified date.
        dateValue1 - The date value for checking if the order items are within the specified date.
        dateOperator2 - The operator for checking if the order items are within the specified date.
        dateValue2 - The date value for checking if the order items are within the specified date.
        Returns:
        true if the promotion is used in the order.
        Throws:
        java.lang.Exception
      • checkShoppingCartForPromotion

        public static boolean checkShoppingCartForPromotion(java.lang.String promotionId,
                                                            java.lang.Long memberId,
                                                            java.lang.Integer storeId)
                                                     throws java.lang.Exception
        This method checks the current shopping cart for the customer to determine if the specified promotion is currently applied.
        Parameters:
        promotionId - The ID of the promotion ID.
        memberId - The member ID for which to check the shopping cart.
        storeId - The unique ID of the store.
        Returns:
        true if the promotion is used in the order.
        Throws:
        java.lang.Exception