/** * Give, for a XObject job in a {@link JobState#STATE_NORMAL} state, the next date at which the job will be * executed, according to its cron expression. Errors are returned in the context map. Can be called for example: * <code> #set($firetime = $xwiki.scheduler.getNextFireTime($job)) * #if (!$firetime || $firetime=="") #error($context.get("error") #else #info("Fire time : * $firetime") #end </code> * Where $job is an XObject, instance of the {@link SchedulerPlugin#XWIKI_JOB_CLASS} XClass * * @param object the wrapped XObject for which to give the fire date * @return the date the job will be executed */ public Date getNextFireTime(Object object) { try { return getNextFireTime(retrieveBaseObject(object)); } catch (Exception e) { // we don't need to push the exception message in the context here // as it should already have been pushed by the throwing exception return null; } }
/** * Give, for a XObject job in a {@link JobState#STATE_NORMAL} state, the next date at which the job will be * executed, according to its cron expression. Errors are returned in the context map. Can be called for example: * <code> #set($firetime = $xwiki.scheduler.getNextFireTime($job)) * #if (!$firetime || $firetime=="") #error($xcontext.get("error") #else #info("Fire time : * $firetime") #end </code> * Where $job is an XObject, instance of the {@link SchedulerPlugin#XWIKI_JOB_CLASS} XClass * * @param object the wrapped XObject for which to give the fire date * @return the date the job will be executed */ public Date getNextFireTime(Object object) { try { return getNextFireTime(retrieveBaseObject(object)); } catch (Exception e) { // we don't need to push the exception message in the context here // as it should already have been pushed by the throwing exception return null; } }