예제 #1
0
  private void populateVO(
      final ComplexTaskInfoVO ctivo,
      final TaskDef_Complex ctd,
      final ComplexTasklet ct,
      final int page) {

    ctivo.setTitle(ctd.getTitle());
    ctivo.setTaskId(ctd.getId());

    if (ct.getComplexTaskDefRoot().hasTimeRestriction()) {
      final long time_incl_kindness =
          ct.getComplexTaskDefRoot().getTimeInMinutesWithKindnessExtensionTime();
      final long time_excl_kindness =
          ct.getComplexTaskDefRoot().getTimeInMinutesWithoutKindnessExtensionTime();
      final long deadline =
          ct.getActiveTry().getStartTime()
              + ct.getActiveTry().getTimeExtension()
              + time_excl_kindness * 60 * 1000;
      ctivo.setRemainingTimeMillis(deadline - System.currentTimeMillis());
      ctivo.setKindnesTimeMillis((time_incl_kindness - time_excl_kindness) * 60 * 1000);
      ctivo.setDeadline(DateUtil.getStringFromMillis(deadline));
    } else {
      ctivo.setRemainingTimeMillis(-1);
      ctivo.setDeadline("-");
    }

    ctivo.setTimeRestricted(ct.getComplexTaskDefRoot().hasTimeRestriction());
    final ProgressInformation pi = ct.getActiveTry().getProgressInformation();
    ctivo.setEverythingProcessed(pi.getProgressPercentage() == 1);

    ctivo.setPage(page);
    ctivo.setNumOfPages(ct.getActiveTry().getNumberOfPages());
    ctivo.setActualTry(ct.getComplexTaskHandlingRoot().getNumberOfTries());
    ctivo.setNumOfTries(ctd.getComplexTaskDefRoot().getTries());
    ctivo.setTryStartTime(DateUtil.getStringFromMillis(ct.getActiveTry().getStartTime()));
    ctivo.setProcessPercentage(nf.format(pi.getProgressPercentage()));
    ctivo.setNumOfSubtasklets(pi.getNumOfSubtasklets());
    ctivo.setNumOfProcessedSubtasklets(pi.getNumOfProcessedSubtasklets());

    ctivo.setHashCode("" + ct.getActiveTry().getPage(page).getHash());
  }