Class DateConditionElementCmdImpl

  • All Implemented Interfaces:
    DateConditionElementCmd, PriceRuleElementCmd,,,,,,

    public class DateConditionElementCmdImpl
    extends PriceRuleElementCmdImpl
    implements DateConditionElementCmd
    The default implementation for the date condition element command. This command is used to determine whether date condition is met.
    See Also:
    Serialized Form
    • Field Detail


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

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

      • DateConditionElementCmdImpl

        public DateConditionElementCmdImpl()
    • Method Detail

      • performExecute

        public void performExecute()
                            throws java.lang.Exception
        The main logic to execute the command. The following checks are made to decide if the condition is true.
        • Whether the current date time is between start date and end date which are defined in the condition.
        • If isEveryDayOfTheWeek is false, check whether the current weekday is in the weekdays defined.
        • If isAllThroughTheDay is false, check whether the current time is within the start time and end time defined.
        Specified by:
        performExecute in interface
        performExecute in class PriceRuleElementCmdImpl
      • getCurrentTime

        public java.sql.Timestamp getCurrentTime()
        Returns the current time from the command context. First, check if pricing date is specified in runtime parameters, which in turn comes from the request properties in original command context when invoking the price rule engine. If not found, check the time from the preview context. Then, check the time from the command context. Finally, check the time from the request properties. If there is no time in the request properties, get the current system time and save it in the request properties for next use.
        The current time. It doesn't return null.
      • validateParameters

        public java.util.List validateParameters(java.util.Map elementParameters)
        This method performs validations.
        Specified by:
        validateParameters in interface PriceRuleElementCmd
        validateParameters in class PriceRuleElementCmdImpl
        elementParameters -
        A list which contains all validation errors.This value will be empty if no errors found. It does not return null.