protected void processTask(Row row)
{
Integer uniqueID = row.getInteger("TASK_UID");
if (uniqueID != null && uniqueID.intValue() >= 0)
{
Task task = m_project.addTask();
TimeUnit durationFormat = MPDUtility.getDurationTimeUnits(row.getInt("TASK_DUR_FMT"));
task.setActualCost(row.getCurrency("TASK_ACT_COST"));
task.setActualDuration(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_ACT_DUR"), durationFormat));
task.setActualFinish(row.getDate("TASK_ACT_FINISH"));
task.setActualOvertimeCost(row.getCurrency("TASK_ACT_OVT_COST"));
task.setActualOvertimeWork(row.getDuration("TASK_ACT_OVT_WORK"));
//task.setActualOvertimeWorkProtected();
task.setActualStart(row.getDate("TASK_ACT_START"));
task.setActualWork(row.getDuration("TASK_ACT_WORK"));
//task.setActualWorkProtected();
task.setACWP(row.getCurrency("TASK_ACWP"));
task.setBaselineCost(row.getCurrency("TASK_BASE_COST"));
task.setBaselineDuration(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_BASE_DUR"), durationFormat));
task.setBaselineFinish(row.getDate("TASK_BASE_FINISH"));
task.setBaselineStart(row.getDate("TASK_BASE_START"));
task.setBaselineWork(row.getDuration("TASK_BASE_WORK"));
//task.setBCWP(row.getCurrency("TASK_BCWP")); //@todo FIXME
//task.setBCWS(row.getCurrency("TASK_BCWS")); //@todo FIXME
task.setCalendar(m_project.getBaseCalendarByUniqueID(row.getInteger("TASK_CAL_UID")));
//task.setConfirmed();
task.setConstraintDate(row.getDate("TASK_CONSTRAINT_DATE"));
task.setConstraintType(ConstraintType.getInstance(row.getInt("TASK_CONSTRAINT_TYPE")));
//task.setContact();
task.setCost(row.getCurrency("TASK_COST"));
//task.setCost1();
//task.setCost2();
//task.setCost3();
//task.setCost4();
//task.setCost5();
//task.setCost6();
//task.setCost7();
//task.setCost8();
//task.setCost9();
//task.setCost10();
//task.setCostVariance();
task.setCreateDate(row.getDate("TASK_CREATION_DATE"));
//task.setCritical(row.getBoolean("TASK_IS_CRITICAL")); @todo FIX ME
//task.setCV();
//task.setDate1();
//task.setDate2();
//task.setDate3();
//task.setDate4();
//task.setDate5();
//task.setDate6();
//task.setDate7();
//task.setDate8();
//task.setDate9();
//task.setDate10();
task.setDeadline(row.getDate("TASK_DEADLINE"));
//task.setDelay();
task.setDuration(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_DUR"), durationFormat));
//task.setDuration1();
//task.setDuration2();
//task.setDuration3();
//task.setDuration4();
//task.setDuration5();
//task.setDuration6();
//task.setDuration7();
//task.setDuration8();
//task.setDuration9();
//task.setDuration10();
task.setDurationVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_DUR_VAR"), durationFormat));
task.setEarlyFinish(row.getDate("TASK_EARLY_FINISH"));
task.setEarlyStart(row.getDate("TASK_EARLY_START"));
//task.setEarnedValueMethod();
task.setEffortDriven(row.getBoolean("TASK_IS_EFFORT_DRIVEN"));
task.setEstimated(row.getBoolean("TASK_DUR_IS_EST"));
task.setExpanded(!row.getBoolean("TASK_IS_COLLAPSED"));
task.setExternalTask(row.getBoolean("TASK_IS_EXTERNAL"));
//task.setExternalTaskProject();
task.setFinish(row.getDate("TASK_FINISH_DATE"));
//task.setFinish1();
//task.setFinish2();
//task.setFinish3();
//task.setFinish4();
//task.setFinish5();
//task.setFinish6();
//task.setFinish7();
//task.setFinish8();
//task.setFinish9();
//task.setFinish10();
//task.setFinishVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_FINISH_VAR"), durationFormat)); // Calculate for consistent results?
//task.setFixed();
task.setFixedCost(row.getCurrency("TASK_FIXED_COST"));
task.setFixedCostAccrual(AccrueType.getInstance(row.getInt("TASK_FIXED_COST_ACCRUAL")));
//task.setFlag1();
//task.setFlag2();
//task.setFlag3();
//task.setFlag4();
//task.setFlag5();
//task.setFlag6();
//task.setFlag7();
//task.setFlag8();
//task.setFlag9();
//task.setFlag10();
//task.setFlag11();
//task.setFlag12();
//task.setFlag13();
//task.setFlag14();
//task.setFlag15();
//task.setFlag16();
//task.setFlag17();
//task.setFlag18();
//task.setFlag19();
//task.setFlag20();
task.setFreeSlack(row.getDuration("TASK_FREE_SLACK").convertUnits(durationFormat, m_project.getProjectHeader()));
task.setHideBar(row.getBoolean("TASK_BAR_IS_HIDDEN"));
//task.setHyperlink();
//task.setHyperlinkAddress();
//task.setHyperlinkSubAddress();
task.setID(row.getInteger("TASK_ID"));
task.setIgnoreResourceCalendar(row.getBoolean("TASK_IGNORES_RES_CAL"));
task.setLateFinish(row.getDate("TASK_LATE_FINISH"));
task.setLateStart(row.getDate("TASK_LATE_START"));
task.setLevelAssignments(row.getBoolean("TASK_LEVELING_ADJUSTS_ASSN"));
task.setLevelingCanSplit(row.getBoolean("TASK_LEVELING_CAN_SPLIT"));
task.setLevelingDelayFormat(MPDUtility.getDurationTimeUnits(row.getInt("TASK_LEVELING_DELAY_FMT")));
task.setLevelingDelay(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_LEVELING_DELAY"), task.getLevelingDelayFormat()));
//task.setLinkedFields(row.getBoolean("TASK_HAS_LINKED_FIELDS")); @todo FIXME
task.setMarked(row.getBoolean("TASK_IS_MARKED"));
task.setMilestone(row.getBoolean("TASK_IS_MILESTONE"));
task.setName(row.getString("TASK_NAME"));
//task.setNull();
//task.setNumber1();
//task.setNumber2();
//task.setNumber3();
//task.setNumber4();
//task.setNumber5();
//task.setNumber6();
//task.setNumber7();
//task.setNumber8();
//task.setNumber9();
//task.setNumber10();
//task.setNumber11();
//task.setNumber12();
//task.setNumber13();
//task.setNumber14();
//task.setNumber15();
//task.setNumber16();
//task.setNumber17();
//task.setNumber18();
//task.setNumber19();
//task.setNumber20();
task.setObjects(getNullOnValue(row.getInteger("TASK_NUM_OBJECTS"), 0));
//task.setOutlineCode1();
//task.setOutlineCode2();
//task.setOutlineCode3();
//task.setOutlineCode4();
//task.setOutlineCode5();
//task.setOutlineCode6();
//task.setOutlineCode7();
//task.setOutlineCode8();
//task.setOutlineCode9();
//task.setOutlineCode10();
task.setOutlineLevel(row.getInteger("TASK_OUTLINE_LEVEL"));
task.setOutlineNumber(row.getString("TASK_OUTLINE_NUM"));
task.setOverAllocated(row.getBoolean("TASK_IS_OVERALLOCATED"));
task.setOvertimeCost(row.getCurrency("TASK_OVT_COST"));
//task.setOvertimeWork();
task.setPercentageComplete(row.getDouble("TASK_PCT_COMP"));
task.setPercentageWorkComplete(row.getDouble("TASK_PCT_WORK_COMP"));
//task.setPhysicalPercentComplete();
task.setPreleveledFinish(row.getDate("TASK_PRELEVELED_FINISH"));
task.setPreleveledStart(row.getDate("TASK_PRELEVELED_START"));
task.setPriority(Priority.getInstance(row.getInt("TASK_PRIORITY")));
task.setRecurring(row.getBoolean("TASK_IS_RECURRING"));
task.setRegularWork(row.getDuration("TASK_REG_WORK"));
task.setRemainingCost(row.getCurrency("TASK_REM_COST"));
task.setRemainingDuration(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_REM_DUR"), durationFormat));
task.setRemainingOvertimeCost(row.getCurrency("TASK_REM_OVT_COST"));
task.setRemainingOvertimeWork(row.getDuration("TASK_REM_OVT_WORK"));
task.setRemainingWork(row.getDuration("TASK_REM_WORK"));
//task.setResourceGroup();
//task.setResourceInitials();
//task.setResourceNames();
task.setResume(row.getDate("TASK_RESUME_DATE"));
//task.setResumeNoEarlierThan();
//task.setResumeValid();
task.setRollup(row.getBoolean("TASK_IS_ROLLED_UP"));
task.setStart(row.getDate("TASK_START_DATE"));
//task.setStart1();
//task.setStart2();
//task.setStart3();
//task.setStart4();
//task.setStart5();
//task.setStart6();
//task.setStart7();
//task.setStart8();
//task.setStart9();
//task.setStart10();
//task.setStartVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("TASK_START_VAR"), durationFormat)); // more accurate by calculation?
task.setStop(row.getDate("TASK_STOP_DATE"));
task.setSummary(row.getBoolean("TASK_IS_SUMMARY"));
//task.setText1();
//task.setText2();
//task.setText3();
//task.setText4();
//task.setText5();
//task.setText6();
//task.setText7();
//task.setText8();
//task.setText9();
//task.setText10();
//task.setText11();
//task.setText12();
//task.setText13();
//task.setText14();
//task.setText15();
//task.setText16();
//task.setText17();
//task.setText18();
//task.setText19();
//task.setText20();
//task.setText21();
//task.setText22();
//task.setText23();
//task.setText24();
//task.setText25();
//task.setText26();
//task.setText27();
//task.setText28();
//task.setText29();
//task.setText30();
//task.setTotalSlack(row.getDuration("TASK_TOTAL_SLACK")); //@todo FIX ME
task.setType(TaskType.getInstance(row.getInt("TASK_TYPE")));
task.setUniqueID(uniqueID);
//task.setUpdateNeeded();
task.setWBS(row.getString("TASK_WBS"));
//task.setWBSLevel();
task.setWork(row.getDuration("TASK_WORK"));
//task.setWorkVariance();
//TASK_HAS_NOTES = false ( java.lang.Boolean)
//TASK_RTF_NOTES = null ( )
String notes = row.getString("TASK_RTF_NOTES");
if (notes != null)
{
if (m_preserveNoteFormatting == false)
{
notes = m_rtf.strip(notes);
}
task.setNotes(notes);
}
//
// Calculate the cost variance
//
if (task.getCost() != null && task.getBaselineCost() != null)
{
task.setCostVariance(NumberUtility.getDouble(task.getCost().doubleValue() - task.getBaselineCost().doubleValue()));
}
//
// Set default flag values
//
task.setFlag1(false);
task.setFlag2(false);
task.setFlag3(false);
task.setFlag4(false);
task.setFlag5(false);
task.setFlag6(false);
task.setFlag7(false);
task.setFlag8(false);
task.setFlag9(false);
task.setFlag10(false);
//
// If we have a WBS value from the MPD file, don't autogenerate
//
if (task.getWBS() != null)
{
m_autoWBS = false;
}
//
// Attempt to identify null tasks
//
if (task.getName() == null && task.getStart() == null && task.getFinish() == null)
{
task.setNull(true);
}
m_project.fireTaskReadEvent(task);
}
}