@Asynchronous
  public void checkImmediately(BatchIntervalInfo info) {

    try {
      List<ProjectInformation> pi =
          projectInformationService.getProjectInformation(info.getUsername(), info.getPassword());
      for (ProjectInformation projectInformation : pi) {
        markCritialTasks(projectInformation, info);
        if (!info.isReportFull()) {
          filterOutNotCriticalTasks(projectInformation, info);
        }
        if (projectInformation.getTasks().size() > 0) {
          send(projectInformation);
        }
      }

    } catch (Exception ex) {
      Logger.getLogger(BatchTimerBean.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
  @Timeout
  public void check(Timer timer) {
    BatchIntervalInfo bi = (BatchIntervalInfo) timer.getInfo();
    try {
      List<ProjectInformation> pi =
          projectInformationService.getProjectInformation(bi.getUsername(), bi.getPassword());
      for (ProjectInformation projectInformation : pi) {
        markCritialTasks(projectInformation, bi);
        if (!bi.isReportFull()) {
          filterOutSendedWarnings(projectInformation, bi);
          filterOutNotCriticalTasks(projectInformation, bi);
        }
        if (projectInformation.getTasks().size() > 0) {
          send(projectInformation);
          markTasksAsSended(projectInformation);
        }
      }

    } catch (Exception ex) {
      Logger.getLogger(BatchTimerBean.class.getName()).log(Level.SEVERE, null, ex);
    }
  }