public class ScheduleSettings<ATTACHEDTO extends Help> extends Object implements Help
api.retainGlobal = true // Schedules are: original interval, 2 minutes interval, original interval, 2 minutes interval, original interval // let's say the original interval is 10 minutes and start at 9:34 then the // sequence of schedules will be: 9:44, 9:46, 9:54, 9:56, 10:04, 10:06, 10:14 // you see that the 10 minute interval is kept, with one run inside that interval def sharedState = api.global if (sharedState.condititionMet) { // switching from original schedule per each run to 2 minut schedule sharedState.condititionMet = false def settings = actionBuilder.getScheduleSettings() // make note of original schedule sharedState.startingDate = settings.getStartingDate() sharedState.numberOfTimeUnits = settings.getNumberOfTimeUnits() settings.setNewNumberOfTimeUnits(2) } else { // switching from 2 minute schedule to original schedule sharedState.condititionMet = true def settings = actionBuilder.getScheduleSettings() def startingDate = sharedState.remove("startingDate") def numberOfTimeUnits = sharedState.remove("numberOfTimeUnits") settings.setNewStartingDate(startingDate) settings.setNewNumberOfTimeUnits(numberOfTimeUnits) // note the logic will go there also for the first ever run, global state is not set yet, // properties are null and using setting.setNew... with null values means "keep the original values" // -> therefore first run is always the original schedule interval }
Constructor and Description |
---|
ScheduleSettings(ATTACHEDTO backLink,
Invocations<MethodInvocationRecord> invocations,
CalculationFlowTimeUnit timeUnit,
BigDecimal numberOfTimeUnits,
String startingDate,
Boolean periodic,
CFTraitType traitType) |
Modifier and Type | Method and Description |
---|---|
ATTACHEDTO |
back() |
void |
clearNewSchedule() |
String |
getDateTimeFormat() |
BigDecimal |
getNewNumberOfTimeUnits()
Gets newly set number of time units.
|
String |
getNewStartingDate()
Gets newly set starting date.
|
CalculationFlowTimeUnit |
getNewTimeUnit()
Gets newly set time unit.
|
BigDecimal |
getNumberOfTimeUnits()
Number of time units to next triggering of schedule.
|
String |
getObjectName() |
String |
getStartingDate()
Starting date and time of the associated formula
|
CalculationFlowTimeUnit |
getTimeUnit()
Gets you time unit as seen in the UI.
|
CFTraitType |
getTraitType() |
Boolean |
isNewPeriodic()
Gets newly set periodicity.
|
Boolean |
isPeriodic()
If this CF item is period or not.
|
boolean |
isScheduleChangeRequested() |
boolean |
isStartImmediatelyTraitActive() |
void |
setNewNumberOfTimeUnits(BigDecimal newNumberOfTimeUnits)
Method that alters the schedule for next run.
|
void |
setNewPeriodic(Boolean newPeriodic)
Method that alters the schedule for next run.
|
void |
setNewStartingDate(String newStartingDate)
Method that alters the schedule for next run.
|
void |
setNewTimeUnit(CalculationFlowTimeUnit newTimeUnit)
Method that alters the schedule for next run.
|
String |
toString() |
public ScheduleSettings(ATTACHEDTO backLink, Invocations<MethodInvocationRecord> invocations, CalculationFlowTimeUnit timeUnit, BigDecimal numberOfTimeUnits, String startingDate, Boolean periodic, CFTraitType traitType)
public String getObjectName()
getObjectName
in interface Help
public CalculationFlowTimeUnit getTimeUnit()
public BigDecimal getNumberOfTimeUnits()
public String getStartingDate()
public Boolean isPeriodic()
public void setNewTimeUnit(CalculationFlowTimeUnit newTimeUnit)
public void setNewNumberOfTimeUnits(BigDecimal newNumberOfTimeUnits)
public void setNewStartingDate(String newStartingDate)
public void setNewPeriodic(Boolean newPeriodic)
public CalculationFlowTimeUnit getNewTimeUnit()
public BigDecimal getNewNumberOfTimeUnits()
public String getNewStartingDate()
public Boolean isNewPeriodic()
public CFTraitType getTraitType()
public boolean isStartImmediatelyTraitActive()
public boolean isScheduleChangeRequested()
public void clearNewSchedule()
public ATTACHEDTO back()
public String getDateTimeFormat()
Copyright © 2019. All rights reserved.