Skip to content

Commit

Permalink
Asta Start and Finish Milestones (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
joniles authored Sep 12, 2024
1 parent 6498937 commit 88f73aa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<body>
<release date="unreleased" version="13.3.2">
<action dev="joniles" type="update">Ensure the Scheduling Progressed Activities project property is populated when reading Phoenix schedules.</action>
<action dev="joniles" type="update">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.</action>
</release>
<release date="2024-08-30" version="13.3.1">
<action dev="joniles" type="update">Handle duplicate custom field value unique IDs when reading MSPDI files.</action>
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/net/sf/mpxj/asta/AstaReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
*/
Expand Down

0 comments on commit 88f73aa

Please sign in to comment.