/
Set up Model Object Schedule from Logic
Set up Model Object Schedule from Logic
Model Object can be scheduled to be recalculated periodically. This schedule can be set either manually via front-end on Model Object detail page, or set up via logic code.
You will need to acquire reference to model object, and then set the schedule.
def schedCtx = model.schedulesContext()
schedCtx.newSchedule('myNewSchedule')
.setStartDate(api.parseDateTime("YYYY-MM-dd'T'HH:mm:ss", '2023-05-03T10:30:42'))
.setPeriod(7, PeriodUnit.DAY)
.setAction('doSomething')
.addOrUpdate()
The smallest period unit to use is a day.
References:
ModelFormulaContextReadWrite.schedulesContext()
ModelSchedulesContextReadWrite.newSchedule()
, multiple selections available,
Related content
Build and Use Parallel Calculation
Build and Use Parallel Calculation
Read with this
How to Create Scheduler
How to Create Scheduler
More like this
Evaluate R-Expressions in Groovy (in Optimization) (DEPRECATED)
Evaluate R-Expressions in Groovy (in Optimization) (DEPRECATED)
Read with this
Schedulers
Schedulers
More like this
Customize Optimization
Customize Optimization
Read with this
DetectChangesSchedule PP
DetectChangesSchedule PP
More like this
Found an issue in documentation? Write to us.