Interface ModelSchedulesContextReadWrite

All Superinterfaces:
ModelSchedulesContextReadOnly

public interface ModelSchedulesContextReadWrite extends ModelSchedulesContextReadOnly
Since:
11.0 Paper Plane
  • 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

      
       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()
       
      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.
      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 otherwise null
      Since:
      11.0 Paper Plane