private void processAssignments ( ) throws SQLException { List < Row > rows = getRows ( "select * from zscheduleitem where zproject=? and z_ent=? order by zorderinactivity" , m_projectID , m_entityMap . get ( "Assignment" ) ) ; for ( Row row : rows ) { Task task = m_project . getTaskByUniqueID ( row . getInteger ( "ZACTIVITY_" ) ) ; Resource resource = m_project . getResourceByUniqueID ( row . getInteger ( "ZRESOURCE" ) ) ; if ( task != null && resource != null ) { ResourceAssignment assignment = task . addResourceAssignment ( resource ) ; assignment . setGUID ( row . getUUID ( "ZUNIQUEID" ) ) ; assignment . setActualFinish ( row . getTimestamp ( "ZGIVENACTUALENDDATE_" ) ) ; assignment . setActualStart ( row . getTimestamp ( "ZGIVENACTUALSTARTDATE_" ) ) ; assignment . setWork ( assignmentDuration ( task , row . getWork ( "ZGIVENWORK_" ) ) ) ; assignment . setOvertimeWork ( assignmentDuration ( task , row . getWork ( "ZGIVENWORKOVERTIME_" ) ) ) ; assignment . setActualWork ( assignmentDuration ( task , row . getWork ( "ZGIVENACTUALWORK_" ) ) ) ; assignment . setActualOvertimeWork ( assignmentDuration ( task , row . getWork ( "ZGIVENACTUALWORKOVERTIME_" ) ) ) ; assignment . setRemainingWork ( assignmentDuration ( task , row . getWork ( "ZGIVENREMAININGWORK_" ) ) ) ; assignment . setLevelingDelay ( row . getDuration ( "ZLEVELINGDELAY_" ) ) ; if ( assignment . getRemainingWork ( ) == null ) { assignment . setRemainingWork ( assignment . getWork ( ) ) ; } if ( resource . getType ( ) == ResourceType . WORK ) { assignment . setUnits ( Double . valueOf ( NumberHelper . getDouble ( row . getDouble ( "ZRESOURCEUNITS_" ) ) * 100.0 ) ) ; } } } }
Read assignment data .