コード例 #1
0
  /**
   * Add a join
   *
   * @param descriptor The join descriptor to add
   * @throws IllegalArgumentException if the descriptor's ID already exists in the workflow
   */
  public void addJoin(JoinDescriptor descriptor) {
    if (getJoin(descriptor.getId()) != null) {
      throw new IllegalArgumentException("Join with id " + descriptor.getId() + " already exists");
    }

    joins.add(descriptor);
  }
コード例 #2
0
  public JoinDescriptor getJoin(int id) {
    for (Iterator iterator = joins.iterator(); iterator.hasNext(); ) {
      JoinDescriptor joinDescriptor = (JoinDescriptor) iterator.next();

      if (joinDescriptor.getId() == id) {
        return joinDescriptor;
      }
    }

    return null;
  }