protected Set<Timer> buildTimers(String kaleoClassName, long kaleoClassPK)
      throws PortalException, SystemException {

    List<KaleoTimer> kaleoTimers =
        kaleoTimerLocalService.getKaleoTimers(kaleoClassName, kaleoClassPK);

    Set<Timer> timers = new HashSet<Timer>(kaleoTimers.size());

    for (KaleoTimer kaleoTimer : kaleoTimers) {
      Timer timer =
          new Timer(kaleoTimer.getName(), kaleoTimer.getDescription(), kaleoTimer.isBlocking());

      timers.add(timer);

      DelayDuration delayDuration =
          new DelayDuration(kaleoTimer.getDuration(), DurationScale.parse(kaleoTimer.getScale()));

      timer.setDelayDuration(delayDuration);

      String recurrenceScale = kaleoTimer.getRecurrenceScale();

      if (Validator.isNotNull(recurrenceScale)) {
        DelayDuration recurrenceDelayDuration =
            new DelayDuration(
                kaleoTimer.getRecurrenceDuration(), DurationScale.parse(recurrenceScale));

        timer.setRecurrence(recurrenceDelayDuration);
      }

      Set<Action> timerActions =
          buildActions(KaleoTimer.class.getName(), kaleoTimer.getKaleoTimerId());

      timer.setActions(timerActions);

      Set<Assignment> reassignments =
          buildAssigments(KaleoTimer.class.getName(), kaleoTimer.getKaleoTimerId());

      timer.setReassignments(reassignments);

      Set<Notification> timerNotifications =
          buildNotifications(KaleoTimer.class.getName(), kaleoTimer.getKaleoTimerId());

      timer.setNotifications(timerNotifications);
    }

    return timers;
  }
  protected void parseTimerActions(Element timersElement, Timer timer) {
    if (timersElement == null) {
      return;
    }

    List<Element> timerActionElements = timersElement.elements("timer-action");

    parseActionElements(timerActionElements, timer);

    List<Element> timerNotificationElements = timersElement.elements("timer-notification");

    parseNotificationElements(timerNotificationElements, timer);

    Element reassignmentsElement = timersElement.element("reassignments");

    if (reassignmentsElement != null) {
      Set<Assignment> assignments = parseAssignments(reassignmentsElement);

      timer.setReassignments(assignments);
    }
  }