Package com.projity.association

Examples of com.projity.association.InvalidAssociationException


   */
  public void setDependencyType(int dependencyType) throws InvalidAssociationException {
    if (((Task)getSuccessor()).isWbsParent()) {
      if (dependencyType == DependencyType.FF ||
          dependencyType == DependencyType.SF) {
        throw new InvalidAssociationException(Messages.getString("Message.parentSuccessorCannotHaveFinishLink"));
      }
    }

    this.dependencyType = dependencyType;
  }
View Full Code Here


    return ((Task)predecessor).wbsDescendentOf((Task) successor);
  }

    public void testValid(boolean allowDuplicate) throws InvalidAssociationException {
      if (isLinkToParent() || isLinkToChild())
        throw new InvalidAssociationException(Messages.getString("Message.cannotLinkToSummary"));

      if (isCircular())
        throw new InvalidAssociationException(Messages.getString("Message.circularDependency"));


      if (!allowDuplicate && predecessor.getSuccessorList().findRight(successor) != null)
        throw new InvalidAssociationException(Messages.getString("Message.cannotLinkTwice"));
    }
View Full Code Here

    return instance;
  }

  public Dependency newDependency(HasDependencies predecessor, HasDependencies successor, int dependencyType, long lead, Object eventSource) throws InvalidAssociationException {
    if (predecessor == successor)
      throw new InvalidAssociationException(Messages.getString("Message.cantLinkToSelf"));
    Task successorTask = (Task)successor;
    if (successorTask.isExternal())
      throw new InvalidAssociationException(Messages.getString("Message.cantLinkToExternal"));
    if (successorTask.isSubproject() && !((SubProj)successorTask).isWritable())
      throw new InvalidAssociationException(Messages.getString("Message.cantLinkToClosedSubproject"));

    Dependency dependency = Dependency.getInstance(predecessor, successor, dependencyType, lead);
    dependency.testValid(false); // throws if exception
    connect(dependency,eventSource);
    dependency.setDirty(true);
View Full Code Here

TOP

Related Classes of com.projity.association.InvalidAssociationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.