I am using Quartz Scheduler (version 1.8.3 due to project limitations), and I have been assigned the task of creating the MS Outlook scheduler for tasks specific to my project. Everything seems fine to work fine, but I really have a huge problem with CronTriggers (this problem also exists in version 2.1 of quartz):
I use CronTriggers for repeating patterns DAILY, WEEKLY, and MONTHLY. In addition to the recurrence pattern, I also provide the option โNo occurrencesโ. It has become the scourge of my life! CronTrigger does not provide options for 'repeatCount', like SimpleTriggers do (error: https://jira.terracotta.org/jira/browse/QTZ-242?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel ) Apparently, this can be fixed in version 2.2, but I canโt wait that long and do not believe that my problem is unique!
A few options that I found worthy of investigation:
Calculate the "EndTime" for CronTrigger, but using my own logic - this does not allow to cover all possible cases, and at best only approximately even for simple cases.
Use a TriggerListener or JobListener to track absences. iterations of the task, since I just need the work to stop after the "N" iterations, and I have a 1: 1 mapping from the task instance in Trigger. It does not seem very feasible and / or effective with the help of any part of the imagination.
Can any of you who have used CronTriggers with the No Entry option please provide some information on how to solve this puzzle?
user725079
source share