Package com.projity.pm.assignment

Examples of com.projity.pm.assignment.Assignment


      if (snapshot == null)
        continue;
      AssociationList snapshotAssignments = snapshot.getHasAssignments().getAssignments();
      if (snapshotAssignments.size() > 0) {
        for (Iterator j = snapshotAssignments.iterator(); j.hasNext();) {
          Assignment assignment = (Assignment) j.next();
          ResourceImpl r = (ResourceImpl) assignment.getResource();
          if (r.isDefault())
            continue;

          Project.Assignments.Assignment.Baseline baseline = m_factory
              .createProjectAssignmentsAssignmentBaseline();
View Full Code Here


//    }, factory);
  }
  private void writeAssigmentBaselinesAndTimephased(final Project.Assignments.Assignment xml,
      ResourceAssignment mpx){ //claur signature changed
    int snapshotId = ((Integer) projitySnapshotIdMap.get(mpx)).intValue();
    final Assignment projityAssignment = (Assignment) projityAssignmentMap.get(mpx);
    // baselines
    final List timephasedList = xml.getTimephasedData();
    TimephasedService.getInstance().consumeTimephased(projityAssignment, new TimephasedConsumer() {
      public void consumeTimephased(Object timephased) {
        TimephasedDataType t=(TimephasedDataType) timephased;
View Full Code Here

  public void consumeTimephased(Schedule schedule,TimephasedConsumer consumer,Object factory){ //claur removed exception
    ObjectFactory mspdiTimephasedFactory=(ObjectFactory)factory;

    if (!(schedule instanceof Assignment))
      return; // only do assignments
    Assignment assignment = (Assignment)schedule;

    long id = 0;

    if ( assignment.getPercentComplete() > 0) {
      doQuery(assignment,mspdiTimephasedFactory, consumer,HasTimeDistributedData.ACTUAL_WORK, TimeDistributedTypeMapper.ASSIGNMENT_ACTUAL_WORK, id++);
    }
    doQuery(assignment,mspdiTimephasedFactory, consumer,HasTimeDistributedData.REMAINING_WORK, TimeDistributedTypeMapper.ASSIGNMENT_REMAINING_WORK, id++);


    Object fields[] = HasTimeDistributedData.baselineWorkTypes;
    Assignment baselineAssignment;
    for (int i = 0; i < fields.length; i++) {
      baselineAssignment = assignment.getBaselineAssignment(new Integer(i), false);
      if (baselineAssignment == null)
        continue;
      int mapType = TimeDistributedTypeMapper.getTimeDistributedType(i,false,baselineAssignment);
View Full Code Here

       end = start;
    long oldEnd = getEnd();
    if (end != oldEnd) {
      super.setEnd(end);
      Iterator i = getAssignments().iterator();
      Assignment assignment;
      while (i.hasNext()) {
        assignment = (Assignment)i.next();
        assignment.setEnd(end);
      }
//      System.out.println("Old End"  + new Date(oldEnd) + " input end " + new Date(end )+ " resulting End " + new Date(getEnd()) + " duration " + DurationFormat.format(getDuration()));
      setRawDuration(getDurationMillis());
    }
    assignParentActualDatesFromChildren();
View Full Code Here

  public void setActualWork(long actualWork, FieldContext context) {

    if (FieldContext.hasInterval(context)) {
      Iterator i = getAssignments().iterator();
      while (i.hasNext()) {
        Assignment assignment = (Assignment) i.next();
        assignment.setActualWork(actualWork,context);
      }
    } else {
      long workValue = Duration.millis(actualWork);
      if (workValue == 0L) {
        setPercentComplete(0);
View Full Code Here

        stop = Math.min(stop,s.getEarliestStop());
      }
    } else {
      Iterator i = getAssignments().iterator();
      while (i.hasNext()) {
        Assignment ass = (Assignment)i.next();
        stop = Math.min(stop,ass.getEarliestStop());
      }
    }
    return stop;
  }
View Full Code Here

    completedThrough = Math.min(completedThrough,getEnd());
    if (completedThrough == getCompletedThrough())
      return;

    Iterator i = getAssignments().iterator();
    Assignment assignment;
    long computedActualStart = Long.MAX_VALUE;
    long assignmentActualStart;
    while (i.hasNext()) {
      assignment = (Assignment)i.next();
      assignment.setCompletedThrough(completedThrough);
      assignmentActualStart = assignment.getActualStart();
      if (assignmentActualStart != 0 && assignmentActualStart < computedActualStart)
        computedActualStart = assignmentActualStart;
    }
    if (computedActualStart == Long.MAX_VALUE)
      computedActualStart = 0;
View Full Code Here

 
  public static TaskSnapshotBackup backup(TaskSnapshot snapshot,boolean backupSchedule){
    if (snapshot==null) return null;
    AssociationList assignments=snapshot.getAssignments();
    Iterator i = assignments.iterator();
    Assignment assignment;
    ArrayList detail=new ArrayList(assignments.size());
    while (i.hasNext()) {
      assignment = (Assignment)i.next();
      detail.add(assignment.backupDetail());
    }
    return new TaskSnapshotBackup(snapshot.getCurrentSchedule(),detail);
  }
View Full Code Here

  public static void restore(TaskSnapshot snapshot,TaskSnapshotBackup backup){
    if (backup==null||snapshot==null) return;
    if (backup.getAssignmentDetails()!=null) snapshot.setCurrentSchedule(backup.getCurrentSchedule());
    AssociationList assignments=snapshot.getAssignments();
    Iterator i = assignments.iterator();
    Assignment assignment;
    Iterator j=backup.getAssignmentDetails().iterator();
    while (i.hasNext()) {
      assignment = (Assignment)i.next();
      assignment.restoreDetail(j.next());
    }
  }
View Full Code Here

      if (createIfDoesntExist)
        baselineSnapshot = createSnapshot(snapshot);
      else
        return null;
    }
    Assignment assignment = baselineSnapshot.findAssignment(resource);

    if (assignment == null && createIfDoesntExist) {
      assignment = Assignment.getInstance(this,resource,1.0,0);
      baselineSnapshot.addAssignment(assignment);
      TaskSchedule baselineSchedule = new TaskSchedule(this,TaskSchedule.CURRENT);
      //baselineSnapshot.set
      baselineSnapshot.setCurrentSchedule(baselineSchedule);
      assignment.setTaskSchedule(baselineSchedule);
      assignment.convertToBaselineAssignment(true);
    }


    return assignment;
  }
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.