Browse our Products

Aspose.Tasks for Java 21.5 Release Notes

All Changes

KeySummaryIssue Type
TASKSNET-4788Add support for SaveOptions.TaskFilter and SaveOptions.TasksComparer options when project is saved to CSV or XLSX formatsEnhancement
TASKSNET-4769Remove an ability to set Tsk.ID when using CalculationMode.Manual and CalculationMode.AutomaticEnhancement
TASKSNET-4793Fix exported value of “Outline Code *” attributes when project is saved to non-MPP formats.Bug
TASKSNET-4792Fix headers in exported XLSX when custom ProjectView is specified.Bug
TASKSNET-4772Fix parsing of “Round” operator in formulasBug
TASKSJAVA-1354Wrong calendar exception usageBug
TASKSNET-4751Fix OverflowException while reading MPP fileBug
TASKSNET-4749Fix tasks splitting in case of splits beginning \ ending in middle of the day.Bug
TASKSNET-4746Fix chart rendering to take chart position into accountBug
TASKSJAVA-1211Fix incorrect ids of task childrenBug
TASKSJAVA-1128Information in Aspose.Tasks for Java resource is not converted correctlyBug
TASKSJAVA-1127Unit of work time is different between Aspose.Tasks for Java 2010 format and 2007 formatBug
TASKSNET-4693Fix task splitting in MPP export not working as expectedBug
TASKSNET-4374Fix file resaved with Aspose.Tasks cannot be opened by MSP 2016Bug

Public API and Backwards Incompatible Changes

The following public methods and properties were deleted:Description
com.aspose.tasks.ResourceAssignment.set(com.aspose.tasks.Key<java.util.Date,com.aspose.tasks.AsnKey>,java.util.Date)
com.aspose.tasks.Task.get(com.aspose.tasks.Key<java.lang.String,com.aspose.tasks.TaskKey>)
com.aspose.tasks.Task.set(com.aspose.tasks.Key<java.util.Date,com.aspose.tasks.TaskKey>,java.util.Date)

Examples and additional notes

Related issue: TASKSNET-4769 - Remove an ability to set Tsk.ID when using CalculationMode.Manual and CalculationMode.Automatic.

The logic for Tsk.ID field was changed: it can no longer be set directly and is calculated by Aspose.Tasks (in the same manner as MS Project doesn’t allow “ID” column to be set). The above is true for CalculationMode.Manual and CalculationMode.Automatic modes.

You can use CalculationMode.None to set the value Tsk.ID on your own risk, but these values can overwritten when project is recalculated (see the example).

Project project = new Project();
Project project = new Project();
Task task = project.getRootTask().getChildren().add("task 1");
// Throws com.aspose.tasks.private_.ms.System.InvalidOperationException in Aspose.Tasks for Java 21.5:
//task.set(Tsk.ID, 100);
project.setCalculationMode(CalculationMode.None);
task.set(Tsk.ID, 100);
System.out.println(task.get(Tsk.ID)); // Outputs 100
project.setCalculationMode(CalculationMode.Automatic);
project.recalculate();
System.out.println(task.get(Tsk.ID)); // Outputs 1

It’s also worth reminding that Tsk.ID cannot be used as a stable identifier of a task because its value can be recalculated when tasks tree is changed. Field Tsk.UID (corresponds to MS Project’s ‘Unique ID’ field) can be used as a stable identifier instead. Consider the following example:

Project project = new Project();
Task task1 = project.getRootTask().getChildren().add("Task 1");
Task task2 = project.getRootTask().getChildren().add("Task 2");
Task task3 = project.getRootTask().getChildren().add("Task 3");

System.out.printf("Task1.ID: %d%n", task1.get(Tsk.ID));
System.out.printf("Task2.ID: %d%n", task2.get(Tsk.ID));
System.out.printf("Task3.ID: %d%n", task3.get(Tsk.ID));

System.out.println();

Task task11 = task1.getChildren().add("Task 11");

System.out.printf("Task1.ID: %d%n", task1.get(Tsk.ID));
System.out.printf("Task11.ID: %d%n", task11.get(Tsk.ID));
System.out.printf("Task2.ID: %d%n", task2.get(Tsk.ID));
System.out.printf("Task3.ID: %d%n", task3.get(Tsk.ID));

The output is

Task1.ID: 1
Task2.ID: 2
Task3.ID: 3

Task1.ID: 1
Task11.ID: 2
Task2.ID: 3
Task3.ID: 4

Thus the values of ‘ID’ field of task2 and task3 were changed after new task is inserted.