diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 74189901db..45b754b044 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -7,6 +7,7 @@ Ensure the Scheduling Progressed Activities project property is populated when reading Phoenix schedules. + When reading milestones from an Asta schedule, ensure that the Activity Type attribute is populated to allow start milestones and finish milestones to be differentiated. Handle duplicate custom field value unique IDs when reading MSPDI files. diff --git a/src/main/java/net/sf/mpxj/asta/AstaReader.java b/src/main/java/net/sf/mpxj/asta/AstaReader.java index 982e85e83e..1083f732ad 100644 --- a/src/main/java/net/sf/mpxj/asta/AstaReader.java +++ b/src/main/java/net/sf/mpxj/asta/AstaReader.java @@ -42,6 +42,7 @@ import net.sf.mpxj.ActivityCode; import net.sf.mpxj.ActivityCodeContainer; import net.sf.mpxj.ActivityCodeValue; +import net.sf.mpxj.ActivityType; import net.sf.mpxj.Availability; import net.sf.mpxj.ChildTaskContainer; import net.sf.mpxj.ConstraintType; @@ -761,6 +762,7 @@ private void populateMilestone(Row row, Task task) //PROGREST_PERIOD //SYMBOL_APPEARANCE //MILESTONE_TYPE + task.setActivityType(getMilestoneType(row)); //PLACEMENU //INTERRUPTIBLE_X //ACTUAL_DURATIONTYPF @@ -839,6 +841,23 @@ private void populateMilestone(Row row, Task task) m_weights.put(task, row.getDouble("OVERALL_PERCENT_COMPL_WEIGHT")); } + /** + * Retrieve the milestone type. + * + * @param row row + * @return milestone type + */ + private ActivityType getMilestoneType(Row row) + { + Integer value = row.getInteger("MILESTONE_TYPE"); + if (value == null) + { + return ActivityType.FINISH_MILESTONE; + } + + return value.intValue() == 1 ? ActivityType.FINISH_MILESTONE : ActivityType.START_MILESTONE; + } + /** * Ensure all tasks have a unique ID. */