Managing Estimated and Milestone Tasks

In Microsoft Project, milestones are used to monitor a project’s progress. Milestones are crucial points in the project. Typically, a milestone’s a task with no duration but any task can be marked as a milestone. Aspose.Tasks helps you manage milestones.

Working with Milestones

The Task class exposes the IsEstimated and IsMilestone properties to manage estimated and milestone tasks:

Viewing Estimated and Milestone Tasks in Microsoft Project

To see whether a task is estimated or marked as a milestone in Microsoft Project double-click a task in the Task Entry form.

Marking an estimated task as a milestone in Microsoft Project

managing estimated milestone tasks in Microsoft Project

Finding out Whether a Task is Estimated or a Milestone

The following code examples show how to find out whether a task is estimated or a milestone using Aspose.Tasks.

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(EstimatedMilestoneTasks.class);
 4
 5Project project = new Project(dataDir + "input.mpp");
 6
 7// Create a ChildTasksCollector instance
 8ChildTasksCollector collector = new ChildTasksCollector();
 9
10// Collect all the tasks from RootTask using TaskUtils
11TaskUtils.apply(project.getRootTask(), collector, 0);
12
13// Parse through all the collected tasks
14for (Task tsk : collector.getTasks()) {
15    String strED = tsk.get(Tsk.IS_EFFORT_DRIVEN) != null ? "EffortDriven" : "Non-EffortDriven";
16    String strCrit = tsk.get(Tsk.IS_CRITICAL) != null ? "Critical" : "Non-Critical";
17    System.out.println(strED);
18    System.out.println(strCrit);
19}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.