Interface ModelSchedulesContextReadWrite
- All Superinterfaces:
ModelSchedulesContextReadOnly
- Since:
- 11.0 Paper Plane
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A builder object helping to add or update a model schedule.Nested classes/interfaces inherited from interface ModelSchedulesContextReadOnly
ModelSchedulesContextReadOnly.ModelSchedule, ModelSchedulesContextReadOnly.PeriodUnit
-
Method Summary
Modifier and TypeMethodDescriptionDeletes a schedule from the model.newSchedule
(String name) Creates or updates a Model Schedule.Methods inherited from interface ModelSchedulesContextReadOnly
schedule, schedules
-
Method Details
-
newSchedule
Creates or updates a Model Schedule.As the schedule name is unique for each model, using newSchedule with an already existing schedule name will update the already existing one.
The following code creates (or updates if already existing) a ModelSchedule named "mySchedule" which will run "refresh_model" action every 7 days from 01/01/2020 12:42
The time value of the start date is important when the period is greater or equal to one day as it will define the time of the day the model action will be executed. In the previous example, every 7 days the action will be executed at 12:42.model.schedulesContext().newSchedule("mySchedule") .setStartDate(api.parseDateTime("yyyy-MM-dd'T'HH:mm:ss", "2020-01-01T12:42:00")) .setPeriod(7, PeriodUnit.DAY) .setAction("refresh_model") .addOrUpdate()
- Parameters:
name
- the name of the schedule to be added or updated- Since:
- 11.0 Paper Plane
-
delete
Deletes a schedule from the model.- Parameters:
name
- the name of the schedule to delete- Returns:
- the deleted
ModelSchedulesContextReadOnly.ModelSchedule
if existing otherwisenull
- Since:
- 11.0 Paper Plane
-