@Override public Date resolveDuedate(String duedate, int maxIterations) { try { DurationHelper dh = new DurationHelper(duedate, clockReader); return dh.getDateAfter(); } catch (Exception e) { throw new FlowableException("couldn't resolve duedate: " + e.getMessage(), e); } }
@Override public Boolean validateDuedate(String duedateDescription, int maxIterations, Date endDate, Date newTimer) { if (endDate != null) { return super.validateDuedate(duedateDescription, maxIterations, endDate, newTimer); } // end date could be part of the cron expression try { if (duedateDescription != null && duedateDescription.startsWith("R")) { return new DurationHelper(duedateDescription, maxIterations, clockReader).isValidDate(newTimer); } else { return true; } } catch (Exception e) { throw new FlowableException("Failed to parse cron expression: " + duedateDescription, e); } }
@Override public Date resolve(String duedateDescription, ClockReader clockReader, TimeZone timeZone) { Calendar nextRun = null; try { if (duedateDescription.startsWith("R")) { nextRun = new DurationHelper(duedateDescription, clockReader).getCalendarAfter(clockReader.getCurrentCalendar(timeZone)); } else { CronExpression cronExpression = new CronExpression(duedateDescription, clockReader); cronExpression.setTimeZone(timeZone); Date nextRunDate = cronExpression.getTimeAfter(clockReader.getCurrentCalendar(timeZone).getTime()); nextRun = new GregorianCalendar(); nextRun.setTime(nextRunDate); } } catch (Exception e) { throw new FlowableException("Failed to parse scheduler expression: " + duedateDescription, e); } return nextRun == null ? null : nextRun.getTime(); }
@Override public Date resolveDuedate(String duedateDescription, int maxIterations) { try { if (duedateDescription != null && duedateDescription.startsWith("R")) { return new DurationHelper(duedateDescription, maxIterations, clockReader).getDateAfter(); } else { CronExpression ce = new CronExpression(duedateDescription, clockReader); return ce.getTimeAfter(clockReader.getCurrentTime()); } } catch (Exception e) { throw new FlowableException("Failed to parse cron expression: " + duedateDescription, e); } }
DurationHelper durationHelper = new DurationHelper(failedJobRetryTimeCycleValue, processEngineConfig.getClock()); int jobRetries = job.getRetries(); if (job.getExceptionMessage() == null) {
String failedJobRetryTimeCycle = activity.getFailedJobRetryTimeCycleValue(); try { DurationHelper durationHelper = new DurationHelper(failedJobRetryTimeCycle, processEngineConfig.getClock()); int jobRetries = job.getRetries(); if (job.getExceptionMessage() == null) {