private void writeAssignment ( ResourceAssignment mpxj ) { ResourceAssignmentType xml = m_factory . createResourceAssignmentType ( ) ; m_project . getResourceAssignment ( ) . add ( xml ) ; Task task = mpxj . getTask ( ) ; Task parentTask = task . getParentTask ( ) ; Integer parentTaskUniqueID = parentTask == null ? null : parentTask . getUniqueID ( ) ; xml . setActivityObjectId ( mpxj . getTaskUniqueID ( ) ) ; xml . setActualCost ( getDouble ( mpxj . getActualCost ( ) ) ) ; xml . setActualFinishDate ( mpxj . getActualFinish ( ) ) ; xml . setActualOvertimeUnits ( getDuration ( mpxj . getActualOvertimeWork ( ) ) ) ; xml . setActualRegularUnits ( getDuration ( mpxj . getActualWork ( ) ) ) ; xml . setActualStartDate ( mpxj . getActualStart ( ) ) ; xml . setActualUnits ( getDuration ( mpxj . getActualWork ( ) ) ) ; xml . setAtCompletionUnits ( getDuration ( mpxj . getRemainingWork ( ) ) ) ; xml . setPlannedCost ( getDouble ( mpxj . getActualCost ( ) ) ) ; xml . setFinishDate ( mpxj . getFinish ( ) ) ; xml . setGUID ( DatatypeConverter . printUUID ( mpxj . getGUID ( ) ) ) ; xml . setObjectId ( mpxj . getUniqueID ( ) ) ; xml . setPlannedDuration ( getDuration ( mpxj . getWork ( ) ) ) ; xml . setPlannedFinishDate ( mpxj . getFinish ( ) ) ; xml . setPlannedStartDate ( mpxj . getStart ( ) ) ; xml . setPlannedUnits ( getDuration ( mpxj . getWork ( ) ) ) ; xml . setPlannedUnitsPerTime ( getPercentage ( mpxj . getUnits ( ) ) ) ; xml . setProjectObjectId ( PROJECT_OBJECT_ID ) ; xml . setRateSource ( "Resource" ) ; xml . setRemainingCost ( getDouble ( mpxj . getActualCost ( ) ) ) ; xml . setRemainingDuration ( getDuration ( mpxj . getRemainingWork ( ) ) ) ; xml . setRemainingFinishDate ( mpxj . getFinish ( ) ) ; xml . setRemainingStartDate ( mpxj . getStart ( ) ) ; xml . setRemainingUnits ( getDuration ( mpxj . getRemainingWork ( ) ) ) ; xml . setRemainingUnitsPerTime ( getPercentage ( mpxj . getUnits ( ) ) ) ; xml . setResourceObjectId ( mpxj . getResourceUniqueID ( ) ) ; xml . setStartDate ( mpxj . getStart ( ) ) ; xml . setWBSObjectId ( parentTaskUniqueID ) ; xml . getUDF ( ) . addAll ( writeUDFType ( FieldTypeClass . ASSIGNMENT , mpxj ) ) ; }
Writes a resource assignment to a PM XML file .