Package com.projity.pm.assignment

Examples of com.projity.pm.assignment.Assignment


    while (i.hasNext()) {
      task = (NormalTask)i.next();
      if (task.validateConstraints())
        addRepaired(task);
      if (task.getAssignments().isEmpty()) {
        Assignment ass = task.addDefaultAssignment();
        ass.setDirty(true);
        task.setDirty(true);
        ErrorLogger.logOnce("NoAssignment","Repaired task with no assignments",null);
        System.out.println("added default ass for " + task);
        addRepaired(task);
      }
View Full Code Here


  }
  public double getPercentComplete() {
    if (isZeroDuration()) { // special case for completion on milestones
      int count = 0;
      double pc = 0;
      Assignment ass;
      Iterator i =getAssignments().iterator();
      while (i.hasNext()) {
        ass = ((Assignment)i.next());
        pc += ass.getPercentComplete();
        count++;
      }
      if (count == 0) // shouldn't happen
        return 0;
      return pc / count;
View Full Code Here

      return new AssociationList(); //empty list
  }

  public boolean isAssignedToMe(){
    for (Iterator i=getAssignments().iterator();i.hasNext();){
      Assignment a=(Assignment)i.next();
      if (a.isMine()) return true;
    }
    return false;
  }
View Full Code Here

   * the default assignment.
   *
   * @param assignment
   */
  public Assignment addDefaultAssignment(){
    Assignment ass = newDefaultAssignment();
    addAssignment(ass);
    return ass;
  }
View Full Code Here

  }
  public void addAssignment(Assignment assignment) {
    //project.beginUndoUpdate();
    boolean recalculateDuration = !assignment.isDefault()
        && assignment.isInitialized() && assignment.isLabor();
    Assignment defaultAssignment = findAssignment(ResourceImpl
        .getUnassignedInstance());

    if (!assignment.isDefault()) {
      // get rid of any default
      if (defaultAssignment != null ) { //Remove any default assignment
View Full Code Here

              newUnits, assignedRate,
              true, true); // conserve total units
        }
      }
      if (getAssignments().isEmpty()) {
        Assignment newDefault = newDefaultAssignment();
        newDefault.usePropertiesOf(assignment); // the default assignment must take on properties of the removed assignment
        AssignmentService.getInstance().connect(newDefault, null);
      }
    }
    setDirty(true);
    //project.endUndoUpdate();
View Full Code Here

  public void setWork(long work, FieldContext context) {

    if (FieldContext.hasInterval(context)) {
      Iterator i = getAssignments().iterator();
      while (i.hasNext()) {
        Assignment assignment = (Assignment) i.next();
        assignment.setWork(work,context);
      }
    } else {
      setWork(work);
    }
  }
View Full Code Here

    double u = newRemainingUnits;
    double remaining = getRemainingUnits();
    double factor= u/remaining;
    Iterator i = getAssignments().iterator();
    while (i.hasNext()) {
      Assignment assignment = (Assignment) i.next();
      double r = assignment.getLaborUnits();
//      if (!assignment.isLabor())
//        continue;
      if (conserveTotalUnits)
        getSchedulingRule().adjustRemainingUnits(assignment, assignment.getRemainingLaborUnits() * multiplier, assignment.getRemainingLaborUnits(), false, false);
      else {
        getSchedulingRule().adjustRemainingUnits(assignment,factor*r,r, false, false);
      }
    }

View Full Code Here

//    long newDuration = (long) (getDurationMillis() * multiplier);
//~~    setRawDuration(newDuration);
    //need to always do children regardless of doChildren flag
    Iterator i = getAssignments().iterator();
    while (i.hasNext()) {
      Assignment assignment = (Assignment) i.next();
      if (!assignment.isLabor())
        continue;
      getSchedulingRule().adjustRemainingWork(assignment,(long) (assignment.getRemainingWork()*multiplier),false);
    }
  }
 
View Full Code Here

//    return stop;
  }

  //Used when an assignment advancement changes
  public void adjustActualStartFromAssignments() {
    Assignment assignment;
    Iterator i = getAssignments().iterator();
    long start = 0L;
    while (i.hasNext()) {
      assignment = (Assignment)i.next();
      if (assignment.getPercentComplete() > 0.0D ) {
        start= getStart();
        break;
      }
    }
//    System.out.println("adjusting actual start to " + new java.util.Date(start));
View Full Code Here

TOP

Related Classes of com.projity.pm.assignment.Assignment

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.