private void processActivity ( Activity activity ) { Task task = getParentTask ( activity ) . addTask ( ) ; task . setText ( 1 , activity . getId ( ) ) ; task . setActualDuration ( activity . getActualDuration ( ) ) ; task . setActualFinish ( activity . getActualFinish ( ) ) ; task . setActualStart ( activity . getActualStart ( ) ) ; //activity.getBaseunit() //activity.getBilled() //activity.getCalendar() //activity.getCostAccount() task . setCreateDate ( activity . getCreationTime ( ) ) ; task . setFinish ( activity . getCurrentFinish ( ) ) ; task . setStart ( activity . getCurrentStart ( ) ) ; task . setName ( activity . getDescription ( ) ) ; task . setDuration ( activity . getDurationAtCompletion ( ) ) ; task . setEarlyFinish ( activity . getEarlyFinish ( ) ) ; task . setEarlyStart ( activity . getEarlyStart ( ) ) ; task . setFreeSlack ( activity . getFreeFloat ( ) ) ; task . setLateFinish ( activity . getLateFinish ( ) ) ; task . setLateStart ( activity . getLateStart ( ) ) ; task . setNotes ( activity . getNotes ( ) ) ; task . setBaselineDuration ( activity . getOriginalDuration ( ) ) ; //activity.getPathFloat() task . setPhysicalPercentComplete ( activity . getPhysicalPercentComplete ( ) ) ; task . setRemainingDuration ( activity . getRemainingDuration ( ) ) ; task . setCost ( activity . getTotalCost ( ) ) ; task . setTotalSlack ( activity . getTotalFloat ( ) ) ; task . setMilestone ( activityIsMilestone ( activity ) ) ; //activity.getUserDefined() task . setGUID ( activity . getUuid ( ) ) ; if ( task . getMilestone ( ) ) { if ( activityIsStartMilestone ( activity ) ) { task . setFinish ( task . getStart ( ) ) ; } else { task . setStart ( task . getFinish ( ) ) ; } } if ( task . getActualStart ( ) == null ) { task . setPercentageComplete ( Integer . valueOf ( 0 ) ) ; } else { if ( task . getActualFinish ( ) != null ) { task . setPercentageComplete ( Integer . valueOf ( 100 ) ) ; } else { Duration remaining = activity . getRemainingDuration ( ) ; Duration total = activity . getDurationAtCompletion ( ) ; if ( remaining != null && total != null && total . getDuration ( ) != 0 ) { double percentComplete = ( ( total . getDuration ( ) - remaining . getDuration ( ) ) * 100.0 ) / total . getDuration ( ) ; task . setPercentageComplete ( Double . valueOf ( percentComplete ) ) ; } } } m_activityMap . put ( activity . getId ( ) , task ) ; }
Create a Task instance from a Phoenix activity .