コード例 #1
0
  public void moveToHistory(Step step) {
    List currentSteps =
        (List) SerializableCache.getInstance().currentStepsCache.get(new Long(step.getEntryId()));

    List historySteps =
        (List) SerializableCache.getInstance().historyStepsCache.get(new Long(step.getEntryId()));

    if (historySteps == null) {
      historySteps = new ArrayList();
      SerializableCache.getInstance()
          .historyStepsCache
          .put(new Long(step.getEntryId()), historySteps);
    }

    SimpleStep simpleStep = (SimpleStep) step;

    for (Iterator iterator = currentSteps.iterator(); iterator.hasNext(); ) {
      Step currentStep = (Step) iterator.next();

      if (simpleStep.getId() == currentStep.getId()) {
        iterator.remove();
        historySteps.add(simpleStep);

        break;
      }
    }

    SerializableCache.store();
  }
コード例 #2
0
  public Step markFinished(Step step, int actionId, Date finishDate, String status, String caller) {
    List currentSteps =
        (List) SerializableCache.getInstance().currentStepsCache.get(new Long(step.getEntryId()));

    for (Iterator iterator = currentSteps.iterator(); iterator.hasNext(); ) {
      SimpleStep theStep = (SimpleStep) iterator.next();

      if (theStep.getId() == step.getId()) {
        theStep.setStatus(status);
        theStep.setActionId(actionId);
        theStep.setFinishDate(finishDate);
        theStep.setCaller(caller);

        return theStep;
      }
    }

    SerializableCache.store();

    return null;
  }