I am developing an application that gives the user the ability to schedule some activity. Inputs that are provided by user are
I am unable to get the cron expressions right for each of the repeat interval type i.e. Hour/Day/Week/Month so that the trigger time is calculated from the start date.
Quartz documentation suggests using a SimpleTrigger http://www.quartz-scheduler.org/docs/cookbook/BiDailyTrigger.html, an example for every other day:
Trigger trigger = new SimpleTrigger("trigger1", "group1");
trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
// 24 hours * 60(minutes per hour) * 60(seconds per minute) * 1000(milliseconds per second)
trigger.setRepeatInterval(2L * 24L * 60L * 60L * 1000L);
Note that you will need to set the trigger start time and the misfire rule.