Class Period


  • public class Period
    extends UC4Object
    An object that holds settings that may be used for periodic execution of tasks. It allows to define the time periods once and reuse this information to start multiple periodic executions.

    Usage Example:

     
    Period period = (Period) open("NAME.OF.PERIOD.OBJECT");
    //Create a ExecuteRecurring instance with the settings from the Period object.
    ExecuteRecurring er = period.createExecuteRecurring();
    executeObject.executeRecurring(er);
     
     
    • Constructor Detail

      • Period

        public Period()
    • Method Detail

      • header

        public Header header()
        Returns the header data of this object. This is the information of the header tab in the dialog client.
        Returns:
        Header
      • isExecutable

        public boolean isExecutable()
        Description copied from class: UC4Object
        Returns true if this Object can be executed.
        Specified by:
        isExecutable in class UC4Object
        Returns:
        true if the Object can be executed, false if not.
      • setTimeframe

        @Deprecated
        public void setTimeframe​(Time start,
                                 Time end,
                                 boolean forceAdjustment)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets the execution time frame.
        Parameters:
        start - Start time
        end - End time
        forceAdjustment - Aligns the start time on the time frame if set to true
      • getTimeframeStart

        @Deprecated
        public Time getTimeframeStart()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns the start time which was set using the method setTimeframe.
        Returns:
        Start time of the Time frame
      • getTimeframeEnd

        @Deprecated
        public Time getTimeframeEnd()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns the end time which was set using the method setTimeframe.
        Returns:
        End time of the Time frame
      • hasTimeframeAdjustment

        @Deprecated
        public boolean hasTimeframeAdjustment()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        True if the start time is aligned to the time frame
      • setExecutionInterval

        @Deprecated
        public void setExecutionInterval​(int every)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets the execution interval in minutes.
        Parameters:
        every - Number of minutes of the execution interval
      • isExecutedInterval

        @Deprecated
        public boolean isExecutedInterval()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        Returns true if an execution interval has been set.
      • getExecutionInterval

        @Deprecated
        public int getExecutionInterval()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        Returns the execution interval in minutes.
      • setGapToPreviousRun

        @Deprecated
        public void setGapToPreviousRun​(int gap)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets the gap to the previous run of the task in minutes.
        Parameters:
        gap - Time gap in minutes
      • isExecutedWithGap

        @Deprecated
        public boolean isExecutedWithGap()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        Returns true if the interval has a gap to the previous run.
      • getGapInterval

        @Deprecated
        public int getGapInterval()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        Returns the time gap in minutes to the previous run.
      • setAtTime

        @Deprecated
        public void setAtTime​(Time time)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets the start time of the task.
        Parameters:
        time - Start time
      • getTimeOfSingleExecution

        @Deprecated
        public Time getTimeOfSingleExecution()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns the start time that has been set using the method setAtTime.
        Returns:
        Start time of the execution
      • isExecutedAtTime

        @Deprecated
        public boolean isExecutedAtTime()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        Returns true if the task is executed at a defined time (the method setAtTime has been called before)
      • setAllowOneOverlap

        @Deprecated
        public void setAllowOneOverlap​(boolean overlap)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets if one overlap should be allowed. If the parameter overlap is set to false there will only be one task at one time even if the old run has not finished.
        Parameters:
        overlap - True if one overlap is allowed
      • isAllowOneOverlap

        @Deprecated
        public boolean isAllowOneOverlap()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        Returns True if one overlap is allowed
      • setDateRange

        @Deprecated
        public void setDateRange​(DateTime startDate,
                                 DateTime endDate)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets the date range for the interval.
        Parameters:
        startDate - Start date
        endDate - End date
      • hasDateRangeWithEndTime

        @Deprecated
        public boolean hasDateRangeWithEndTime()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        True if a date range was specified using a start date and an end date
      • getRangeStartDate

        @Deprecated
        public DateTime getRangeStartDate()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns the start date of of the date range which has been set using the method setDateRange.
        Returns:
        Start Date
      • getRangeEndDate

        @Deprecated
        public DateTime getRangeEndDate()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns the end date of the date range which has been set using the method setDateRange.
        Returns:
        End date
      • setRangeWithoutEnd

        @Deprecated
        public void setRangeWithoutEnd​(DateTime startDate)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets a date range with a start date and an open end date.
        Parameters:
        startDate - start date
      • hasDateRangeWithoutEnd

        @Deprecated
        public boolean hasDateRangeWithoutEnd()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        Returns true if the date range was specified only by a start date
      • setDateRange

        @Deprecated
        public void setDateRange​(DateTime startDate,
                                 int runs)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets a date range using a start date and a number of runs.
        Parameters:
        startDate - Start date
        runs - Number of run
      • getDateRangeRuns

        @Deprecated
        public int getDateRangeRuns()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        Returns the number of runs of the date range.
      • hasDateRangeRuns

        @Deprecated
        public boolean hasDateRangeRuns()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        Returns true if the date range was specified using a start date and a number of runs.
      • setCalendarCondition

        @Deprecated
        public void setCalendarCondition​(TaskCalendar calendar)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets the calendar condition of the recurring tasks.
        Parameters:
        calendar - Calendar condition
      • getCalendarCondition

        @Deprecated
        public TaskCalendar getCalendarCondition()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns the calendar condition which has been set using the method setCalendarCondition.
        Returns:
        Calendar condition
      • setWeekDays

        @Deprecated
        public void setWeekDays​(boolean mo,
                                boolean tu,
                                boolean we,
                                boolean th,
                                boolean fr,
                                boolean sa,
                                boolean su)
        Deprecated.
        Use setExecuteRecurring() instead
        Sets Weekdays.
        Parameters:
        mo - Monday
        tu - Tuesday
        we - Wednesday
        th - Thursday
        fr - Friday
        sa - Saturday
        su - Sunday
      • runsOnDefinedWeekdays

        @Deprecated
        public boolean runsOnDefinedWeekdays()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns true if the task runs on defined week days. This method returns true if setWeekDays has been called before.

        Note: When this method returns true, calls to runsOnDefinedCalendar() will return false.

        Returns:
        True if weekdays are used as calendar condition
      • runsOnDefinedCalendar

        @Deprecated
        public boolean runsOnDefinedCalendar()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns true if the task runs based on calendar conditions. This method returns true if setCalendarCondition(TaskCalendar) has been called before.

        Note: When this method returns true, calls to runsOnDefinedWeekdays() will return false.

        Returns:
        Returns true if the task runs on defined calendar conditions
      • isSunday

        @Deprecated
        public boolean isSunday()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        True if Sunday is selected and the task runs on weekdays
      • isMonday

        @Deprecated
        public boolean isMonday()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        True if Monday is selected and the task runs on weekdays
      • isTuesday

        @Deprecated
        public boolean isTuesday()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        True if Tuesday is selected and the task runs on weekdays
      • isWednesday

        @Deprecated
        public boolean isWednesday()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        True if Wednesday is selected and the task runs on weekdays
      • isThursday

        @Deprecated
        public boolean isThursday()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        True if Thursday is selected and the task runs on weekdays
      • isFriday

        @Deprecated
        public boolean isFriday()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        True if Friday is selected and the task runs on weekdays
      • isSaturday

        @Deprecated
        public boolean isSaturday()
        Deprecated.
        Use getExecuteRecurring() instead
        Returns:
        True if Saturday is selected and the task runs on weekdays
      • setExecuteRecurring

        public void setExecuteRecurring​(ExecuteRecurring executeRecurring)
        This method is used to set the ExecuteRecurring details.
        Parameters:
        executeRecurring - ExecuteRecurring instance