class ScheduledReference {

   public boolean restore(ActionContext context) {
      Date scheduleEvent=context.getVariable(name, Date.class);
      if(scheduleEvent!=null){
         context.logger().debug("A scheduled event was found and is being restored for {}",scheduleEvent);
         if(scheduleEvent.before(context.getLocalTime().getTime())){
            scheduleEvent=context.getLocalTime().getTime();
            context.setVariable(name,scheduleEvent);
         }
         context.wakeUpAt(scheduleEvent);
         return true;
      }
      return false;
   }

   public  ScheduledReference(String name);

}