Utility Features Available in Aspose.Tasks for Java

Calculating Critical Path

The critical path is the tasks, or task, that ultimately determine when your project will end. Keeping track of the critical path and the resources assigned to them helps keep the project on time. Microsoft Project calculates the critical path based on tasks that have no slack, have specific date constraints (must start on, must finish on, as soon as possible or as late as possible) or have the same, or later, end date as the project. Aspose.Tasks allows you to calculate the critical path.

The Project class provides the getCriticalPath() method which is used to get the list of tasks that part of the critical path.

The following piece of code calculates and displays the tasks in the critical path.

Printing the TaskWritingException

A project consists of a number of tasks and Aspose.Tasks for Java API allows adding, removing and updating task information. If there’s a problem when writing tasks, use TasksWritingException to catch them.

Aspose.Tasks for Java supports printing a message when there’s an exception in writing a task. This is done with TaskWritingException, in a similar way to how TaskReadingException is used. The log message is contained in the public property TasksWritingException.getLogText(), as shown in the following code example.

Working with Filter Data from MPP files

Aspose.Tasks allows to read Information about filters applied to an MPP file data. This topic shows retrieving Filter Definition and Filter Criteria data from a Microsoft Project MPP file.

Reading Filter Definition Data

Reading Filter Criteria Data

Reading Group Definition Data

A Microsoft Project data file may contain data in groups. Aspose.Tasks for Java provides the facility to read the group definition data as shown in this topic.

Reading Table Data from a Project File

Aspose.Tasks for Java API supports reading Table data from Microsoft Project data files. The Project.Tables implements the ICollection interface to provide access to the Table data of MPP file. The feature is supported for all versions of Microsoft Project data files i.e. MPP 2003, 2007, 2010 and 2013.

Extracting Embedded Objects from Task or Resource View

Microsoft Project data files (MPP/XML) may contain embedded objects such as documents, excel sheets, PDF, images, etc. in Task or Resource views. Aspose.Tasks for Java API provides the capability to extract these from a project’s Task or Resource view as shown in this topic.

Embedded objects (those which were created from the file by selecting a file path) are packed into OLE Package inside MPP file. To extract the original file you can use Content and FullPath properties of an instance of the OleObject class.