Class ExecuteRecurring

  • All Implemented Interfaces:
    HasAlias, java.lang.Cloneable

    public class ExecuteRecurring
    extends java.lang.Object
    implements java.lang.Cloneable, HasAlias
    Recurring definition of a task.
    • Constructor Detail

      • ExecuteRecurring

        public ExecuteRecurring()
        Constructs a new ExecuteRecurring instance with the default setting to execute the task every 30 minutes on each weekday.
      • ExecuteRecurring

        public ExecuteRecurring​(UC4ObjectName uc4ObjectNamme)
        Constructs a new ExecuteRecurring instance by also providing the uc4 object name of the recurring object with the default setting to execute the task every 30 minutes on each weekday.
        Parameters:
        uc4ObjectNamme - The name of the UC4 object
    • Method Detail

      • clone

        public ExecuteRecurring clone()
        Overrides:
        clone in class java.lang.Object
      • getAlias

        public UC4Alias getAlias()
        Returns the alias or null if it has not been set.
        Specified by:
        getAlias in interface HasAlias
        Returns:
        UC4 Alias
      • setAlias

        public void setAlias​(UC4Alias alias)
        Sets the alias of a recurring task.
        Parameters:
        alias - UC4 Alias
      • setTimeframe

        public void setTimeframe​(Time start,
                                 Time end,
                                 boolean forceAdjustment)
        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

        public Time getTimeframeStart()
        Returns the start time which was set using the method setTimeframe.
        Returns:
        Start time of the Time frame
      • getQueue

        public UC4ObjectName getQueue()
        Returns the Queue Object.
        Returns:
        Name of the Queue Object
      • setQueue

        public void setQueue​(UC4ObjectName queue)
        Sets the Queue that will be used when this Automation Engine object is executed.
        Parameters:
        queue - Name of the Queue Object
      • getTimeframeEnd

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

        public boolean hasTimeframeAdjustment()
        Returns:
        True if the start time is aligned to the time frame
      • setExecutionInterval

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

        public boolean isExecutedInterval()
        Returns:
        Returns true if an execution interval has been set.
      • getExecutionInterval

        public int getExecutionInterval()
        Returns:
        Returns the execution interval in minutes.
      • setGapToPreviousRun

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

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

        public int getGapInterval()
        Returns:
        Returns the time gap in minutes to the previous run.
      • setAtTime

        public void setAtTime​(Time time)
        Sets the start time of the task.
        Parameters:
        time - Start time
      • setOnce

        public void setOnce​(Time time)
        Sets the time of the once field
        Parameters:
        time - Start time of the once execution
      • getTimeOfSingleExecution

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

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

        public void setAllowOneOverlap​(boolean overlap)
        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

        public boolean isAllowOneOverlap()
        Returns:
        Returns True if one overlap is allowed
      • setTimeZone

        public void setTimeZone​(UC4TimezoneName tz)
        Sets the time zone of all dates used in this class.
        Parameters:
        tz - Time zone
      • getTimeZone

        public UC4TimezoneName getTimeZone()
        Returns:
        Returns the time zone name or an empty name if the default is used.
      • setDateRange

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

        public boolean hasDateRangeWithEndTime()
        Returns:
        True if a date range was specified using a start date and an end date
      • getRangeStartDate

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

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

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

        public boolean hasDateRangeWithoutEnd()
        Returns:
        Returns true if the date range was specified only by a start date
      • setDateRange

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

        public int getDateRangeRuns()
        Returns:
        Returns the number of runs of the date range.
      • hasDateRangeRuns

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

        public void setCalendarCondition​(TaskCalendar calendar)
        Sets the calendar condition of the recurring tasks.
        Parameters:
        calendar - Calendar condition
      • setWeekDays

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

        public boolean runsOnDefinedWeekdays()
        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

        public boolean runsOnDefinedCalendar()
        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

        public boolean isSunday()
        Returns:
        True if sunday is selected and the task runs on weekdays
      • isMonday

        public boolean isMonday()
        Returns:
        True if monday is selected and the task runs on weekdays
      • isTuesday

        public boolean isTuesday()
        Returns:
        True if tuesday is selected and the task runs on weekdays
      • isWednesday

        public boolean isWednesday()
        Returns:
        True if wednesday is selected and the task runs on weekdays
      • isThursday

        public boolean isThursday()
        Returns:
        True if thursday is selected and the task runs on weekdays
      • isFriday

        public boolean isFriday()
        Returns:
        True if friday is selected and the task runs on weekdays
      • isSaturday

        public boolean isSaturday()
        Returns:
        True if saturday is selected and the task runs on weekdays
      • store

        public void store​(com.uc4.util.XMLDocument doc,
                          org.w3c.dom.Element execPeriod)
        Only for internal use.

        Stores the content of this class under the specified XML element in doc.

        Parameters:
        doc - XML Document
        execPeriod - Element
      • setPeriodDescription

        public void setPeriodDescription​(java.lang.String periodDescription)
        Sets the description that describes the execution cycle of this instance.
        Parameters:
        periodDescription - The new description.
        Throws:
        java.lang.IllegalArgumentException - when periodDescription is longer than 255 characters.
      • getPeriodDescription

        public java.lang.String getPeriodDescription()
        Description of the periodic cycle in which executions are triggered. When this object is based on a Period instance, the period description is initialized with title of the Period instance.
        Returns:
        Description for this object, or null if no description has been specified.
        See Also:
        Period.createExecuteRecurring()
      • getName

        public UC4ObjectName getName()
        Returns the name or null if it has not been set.
        Returns:
        UC4 Name