public class Period extends UC4Object
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 and Description |
---|
Period() |
Modifier and Type | Method and Description |
---|---|
ExecuteRecurring |
createExecuteRecurring()
Creates a new
ExecuteRecurring instance with the settings copied from this Period object. |
TaskCalendar |
getCalendarCondition()
Returns the calendar condition which has been set using
the method
setCalendarCondition . |
int |
getDateRangeRuns() |
int |
getExecutionInterval() |
int |
getGapInterval() |
DateTime |
getRangeEndDate()
Returns the end date of the date range which has been set using
the method
setDateRange . |
DateTime |
getRangeStartDate()
Returns the start date of of the date range which has been set using
the method
setDateRange . |
Time |
getTimeframeEnd()
Returns the end time which was set using the method
setTimeframe . |
Time |
getTimeframeStart()
Returns the start time which was set using the method
setTimeframe . |
Time |
getTimeOfSingleExecution()
Returns the start time that has been set using the method
setAtTime . |
boolean |
hasDateRangeRuns() |
boolean |
hasDateRangeWithEndTime() |
boolean |
hasDateRangeWithoutEnd() |
boolean |
hasTimeframeAdjustment() |
Header |
header()
Returns the header data of this object.
|
boolean |
isAllowOneOverlap() |
boolean |
isExecutable()
Returns
true if this Object can be executed. |
boolean |
isExecutedAtTime() |
boolean |
isExecutedInterval() |
boolean |
isExecutedWithGap() |
boolean |
isFriday() |
boolean |
isMonday() |
boolean |
isSaturday() |
boolean |
isSunday() |
boolean |
isThursday() |
boolean |
isTuesday() |
boolean |
isWednesday() |
boolean |
runsOnDefinedCalendar()
Returns true if the task runs based on calendar conditions.
|
boolean |
runsOnDefinedWeekdays()
Returns true if the task runs on defined week days.
|
void |
setAllowOneOverlap(boolean overlap)
Sets if one overlap should be allowed.
|
void |
setAtTime(Time time)
Sets the start time of the task.
|
void |
setCalendarCondition(TaskCalendar calendar)
Sets the calendar condition of the recurring tasks.
|
void |
setDateRange(DateTime startDate,
DateTime endDate)
Sets the date range for the interval.
|
void |
setDateRange(DateTime startDate,
int runs)
Sets a date range using a start date and a number of runs.
|
void |
setExecutionInterval(int every)
Sets the execution interval in minutes.
|
void |
setGapToPreviousRun(int gap)
Sets the gap to the previous run of the task in minutes.
|
void |
setRangeWithoutEnd(DateTime startDate)
Sets a date range with a start date and an open end date.
|
void |
setTimeframe(Time start,
Time end,
boolean forceAdjustment)
Sets the execution time frame.
|
void |
setWeekDays(boolean mo,
boolean tu,
boolean we,
boolean th,
boolean fr,
boolean sa,
boolean su)
Sets Weekdays.
|
public Header header()
public boolean isExecutable()
UC4Object
true
if this Object can be executed.isExecutable
in class UC4Object
public void setTimeframe(Time start, Time end, boolean forceAdjustment)
start
- Start timeend
- End timeforceAdjustment
- Aligns the start time on the time frame if set to truepublic Time getTimeframeStart()
setTimeframe
.public Time getTimeframeEnd()
setTimeframe
.public boolean hasTimeframeAdjustment()
public void setExecutionInterval(int every)
every
- Number of minutes of the execution intervalpublic boolean isExecutedInterval()
public int getExecutionInterval()
public void setGapToPreviousRun(int gap)
gap
- Time gap in minutespublic boolean isExecutedWithGap()
public int getGapInterval()
public void setAtTime(Time time)
time
- Start timepublic Time getTimeOfSingleExecution()
setAtTime
.public boolean isExecutedAtTime()
public void setAllowOneOverlap(boolean overlap)
overlap
is set to false
there will only
be one task at one time even if the old run has not finished.overlap
- True if one overlap is allowedpublic boolean isAllowOneOverlap()
public void setDateRange(DateTime startDate, DateTime endDate)
startDate
- Start dateendDate
- End datepublic boolean hasDateRangeWithEndTime()
public DateTime getRangeStartDate()
setDateRange
.public DateTime getRangeEndDate()
setDateRange
.public void setRangeWithoutEnd(DateTime startDate)
startDate
- start datepublic boolean hasDateRangeWithoutEnd()
public void setDateRange(DateTime startDate, int runs)
startDate
- Start dateruns
- Number of runpublic int getDateRangeRuns()
public boolean hasDateRangeRuns()
public void setCalendarCondition(TaskCalendar calendar)
calendar
- Calendar conditionpublic TaskCalendar getCalendarCondition()
setCalendarCondition
.public void setWeekDays(boolean mo, boolean tu, boolean we, boolean th, boolean fr, boolean sa, boolean su)
mo
- Mondaytu
- Tuesdaywe
- Wednesdayth
- Thursdayfr
- Fridaysa
- Saturdaysu
- Sundaypublic boolean runsOnDefinedWeekdays()
true
if setWeekDays
has been called before.
Note: When this method returns true, calls to runsOnDefinedCalendar()
will return false.
public boolean runsOnDefinedCalendar()
true
if setCalendarCondition(TaskCalendar)
has been called before.
Note: When this method returns true, calls to runsOnDefinedWeekdays()
will return false.
public boolean isSunday()
public boolean isMonday()
public boolean isTuesday()
public boolean isWednesday()
public boolean isThursday()
public boolean isFriday()
public boolean isSaturday()
public ExecuteRecurring createExecuteRecurring()
ExecuteRecurring
instance with the settings copied from this Period object.
The content of header()
.getTitle() is transfered to the description field of the returned ExecuteRecurring
object.
java.lang.IllegalArgumentException
- When header()
.getTitle() is longer than 255 characters.ExecuteRecurring.getPeriodDescription()
,
Header.getTitle()