Cross Project Predecessors
Contents
[
Hide
Show
]Microsoft Project lets users link tasks within the current project, or to external projects. Cross-project predecessors are predecessors from another project. Aspose.Tasks support these too.
Working with Cross-Project Predecessor Tasks
In Aspose.Tasks for Java the CrossProjectName and IsCrossProject properties exposed by the TaskLink class are used to handle cross-project predecessors.
- CrossProjectName represents the external predecessor project (string).
- IsCrossProject determines whether a predecessor is part of another project (Boolean).
To manage cross-project predecessor tasks in Microsoft Project from the Tools menu, select Links between Projects.
Cross-project predecessors in Microsoft Project
Getting Cross-Project Predecessor Tasks using Aspose.Tasks
Here, we shall display predecessor and successor task traversing the task links in the project.
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(CrossProjectPredecessors.class);
4
5Project prj = new Project(dataDir + "project5.mpp");
6
7for (TaskLink tsklnk : prj.getTaskLinks()) {
8 if (tsklnk.isCrossProject())
9 System.out.println(tsklnk.getCrossProjectName());
10}