Example #1
0
  public LinkedList<WorklistElement> get(WorklistElement elem) {
    Collection<WorklistElement> rawValues = imap.get(new Key(elem.getContext(), elem.getNode()));

    if (rawValues == null) {
      return null;

    } else {
      LinkedList<WorklistElement> result = new LinkedList<WorklistElement>();
      States elemStates = elem.getStates();

      for (WorklistElement raw : rawValues) {
        WorklistElement clone = raw.clone();

        for (int i = 0; i < elemStates.size(); i++) {
          // substitute empty state tuples
          if (clone.getStates().state(i).equals(initStates.state(i))) {
            Context con = elemStates.state(i);
            clone.setState(i, con);
          }
        }

        result.add(clone);
      }

      return result;
    }
  }