Baseline Task Scheduling
Contents
[
Hide
Show
]Baseline Task Scheduling
The Start and Finish properties exposed by the TaskBaseLine class are used to read and write a task’s start and finish dates when the baseline was saved. Both properties support the Date data type.
After saving a baseline, the task baseline schedule can be viewed in Microsoft Project:
- From the View menu, select More Views and then Task Entry.
- From the Insert menu, select Columns.
- Add the desired columns.
Baseline start and end dates in Microsoft Project
Getting Task Baseline Schedule using Aspose.Tasks
The code below displays the task baseline schedule in a console window after traversing a task’s baselines.
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(BaselineTaskScheduling.class);
4
5long OneSec = 10000000;// microsecond * 10
6long OneMin = 60 * OneSec;
7long OneHour = 60 * OneMin;
8
9Project project = new Project();
10// Creating TaskBaseline:
11Task task = project.getRootTask().getChildren().add("Task");
12project.setBaseline(BaselineType.Baseline);
13
14TaskBaseline baseline = task.getBaselines().toList().get(0);
15System.out.println(baseline.getDuration().toDouble() / OneHour + " Hours");
16System.out.println("Baseline Start: " + baseline.getStart());
17System.out.println("Baseline Finish: " + baseline.getFinish());