Is it possible to directly set schedules for a config via Scripting API? I am wanting to use a configuration where an end-user can define a cron schedule and have that be set across several other configurations. Best way I have currently found involves using inheritance in an interesting way, something like the following:
In the "set schedule" config:
def someNewScheduleStr = "0/15 * * 1/1 * ? *"
vars.get('scheduleToInherit').setValue(someNewScheduleStr,true)
Since scheduleToInherit var is not overwritten in the "set schedule" config, passing in "true" as the boolean will set the variable further up the config tree. The configs with schedule changes, as children of the parent with the variable, then have this in the expression field when cron schedule is set:
${vars.getValue('scheduleToInherit')}
Is there a cleaner way to do this?
- solved #2
- replies 2
- views 489
- stars 0