Browse our Products

Aspose.Tasks for Java 22.4 Release Notes

All Changes

KeySummaryIssue Type
TASKSJAVA-1130Support for thread interruption for Project loading operationNew Feature
TASKSNET-10310Add cancellation token support for Project loading operationNew Feature
TASKSNET-10498Add reading/writing of Status date from/to XER file.Enhancement
TASKSNET-10496Make WorkingTime immutableEnhancement
TASKSNET-10480Add an API to set user-specified callback which allows to substitute absent fonts when a project is rendered to a graphical formatEnhancement
TASKSNET-10471Remove unnecessary memory allocations when reading Task, Assignment, Resource properties.Enhancement
TASKSNET-2596Add support for “Calculation for task and group summary rows” custom field optionEnhancement
TASKSNET-10499Fix reading\writing of Guids from\to XER fileBug
TASKSNET-10485Fix rendering of holidays in Gantt Chart viewBug
TASKSNET-10484Fix reading of Finish Milestones from XER formatBug
TASKSNET-10483Fix parsing of formulas with different separatorsBug
TASKSNET-10479Fix differences of calculated custom fields between versionsBug

Public API and Backwards Incompatible Changes

The following public types were added:Description
com.aspose.tasks.FontResolveCallbackDelegateRepresents a method callback to handle font resolve event.
com.aspose.tasks.FontResolveEventArgsProvides arguments for the callback that is invoked when font is resolved.
com.aspose.tasks.SummaryRowsCalculationTypeSpecifies the type of a calculation of the custom attribute’s value for summary rows.
com.aspose.tasks.FontDescriptorRepresents font information.
com.aspose.tasks.FontStylesSpecifies style information applied to text.
The following public methods and properties were added:Description
com.aspose.tasks.ExtendedAttributeDefinition.SummaryRowsCalculationTypeGets or sets the type of calculation of the custom attribute’s value for summary rows.
com.aspose.tasks.FontResolveEventArgs.RequestedFontNameGets the name of requested font.
com.aspose.tasks.FontResolveEventArgs.ResolvedFontNameGets or sets the name of resolved font. Can be set to control fonts used to render a view.
com.aspose.tasks.OleObject.#ctorInitializes a new instance of the class.
com.aspose.tasks.Project.enumerateAllChildTasksRecursively enumerates all project’s tasks including root task.
com.aspose.tasks.Saving.HtmlSaveOptions.FontResolveCallbackGets or sets a callback which can be used to customize resolved fonts.
com.aspose.tasks.Saving.ImageSaveOptions.FontResolveCallbackGets or sets a callback which can be used to customize resolved fonts.
com.aspose.tasks.Saving.PdfSaveOptions.FontResolveCallbackGets or sets a callback which can be used to customize resolved fonts.
com.aspose.tasks.FontDescriptor.#ctor(String,float)Initializes a new instance of the class with the specified font family and size.
com.aspose.tasks.FontDescriptor.#ctor(String,float,com.aspose.tasks.FontStyles)Initializes a new instance of the class with the specified font family, size and style.
com.aspose.tasks.FontDescriptor.#ctor(com.aspose.tasks.FontDescriptor,com.aspose.tasks.FontStyles)Initializes a new instance of the class with the specified font and style.
com.aspose.tasks.FontDescriptor.FontFamilyGets the name of the font’s family.
com.aspose.tasks.FontDescriptor.SizeGets size of the font.
com.aspose.tasks.FontDescriptor.StyleGets style of the font.
com.aspose.tasks.TableTextStyle.#ctor(int,com.aspose.tasks.FontDescriptor)Initializes a new instance of the class with the specified font.
com.aspose.tasks.TableTextStyle.#ctor(int,float,com.aspose.tasks.FontStyles)Initializes a new instance of the class with the specified font size and font style.
com.aspose.tasks.TableTextStyle.#ctor(int,com.aspose.tasks.FontStyles)Initializes a new instance of the class with the default font settings and the specified font style.
com.aspose.tasks.TextStyle.#ctor(float,com.aspose.tasks.FontStyles)Initializes a new instance of the class with the default font and specified font size and style.
com.aspose.tasks.TextStyle.#ctor(com.aspose.tasks.FontStyles)Initializes a new instance of the class with the default font and specified font style.
com.aspose.tasks.TextStyle.#ctor(com.aspose.tasks.FontDescriptor)Initializes a new instance of the class with the specified font settings.
com.aspose.tasks.TextStyle.FontGets or sets font of the text style.
com.aspose.tasks.WorkingTime.#ctor(double,double)Initializes a new instance of the class with an interval item with the specified start and finish times.
com.aspose.tasks.WorkingTime.#ctor(int,int)Initializes a new instance of the class with an interval item with the specified start and finish times.
com.aspose.tasks.WorkingTime.FromGets the beginning of a working time.
com.aspose.tasks.WorkingTime.ToGets the end of a working time.
The following public methods and properties were deleted:Description
com.aspose.tasks.WorkWeek.#ctor(com.aspose.tasks.Calendar)
The following public enumerations were added:Description
com.aspose.tasks.SummaryRowsCalculationType.NoneMeans the custom attribute’s value for summary rows is not calculated.
com.aspose.tasks.SummaryRowsCalculationType.RollupMeans the custom attribute’s value for summary rows is calculated using rollup function defined in .
com.aspose.tasks.SummaryRowsCalculationType.UseFormulaMeans the custom attribute’s value for summary rows is calculated using formula defined in .
com.aspose.tasks.FontStyles.RegularNormal text.
com.aspose.tasks.FontStyles.BoldBold text.
com.aspose.tasks.FontStyles.ItalicItalic text.
com.aspose.tasks.FontStyles.UnderlineUnderlined text.
com.aspose.tasks.FontStyles.StrikeoutText with a line through the middle.

Examples and additional notes

Related issue: TASKSNET-10310 - Add cancellation token support for Project loading operation

Now CancellationToken can be specified to allow cancellation of long project loading operation:

CancellationTokenSource cts = new CancellationTokenSource();

LoadOptions loadOptions = new LoadOptions() {{
    setCancellationToken(cts.getToken());
}};

Project p = new Project("test.mpp", loadOptions);

Related issue: TASKSNET-10480 - Add an API to set user-specified callback which allows to substitute absent fonts when a project is rendered to a graphical format

The user can use any font to customize View’s text styles using MS Project. When the project is saved, the font information (actually a font name and size) is persisted to MPP file. Sometimes the resulting MPP file is opened on another environment where the specified font may be missing. To address this issue we introduced FontResolveCallback which can be used to intercept font resolving event. The callback is invoked when the project’s view is saved to a graphical format and the rendering engine resolves a font to render a text.

Project project = new Project("Input.mpp");
PdfSaveOptions so = new PdfSaveOptions();
so.setPresentationFormat(PresentationFormat.GanttChart);
so.setTimescale(Timescale.DefinedInView);
so.setFontResolveCallback(new FontResolveCallbackDelegate() {
    @Override
    public void invoke(FontResolveEventArgs args) {
        if (!Objects.equals(args.getRequestedFontName(), args.getResolvedFontName())) {
            // Looks like the exact font cannot be found and fallback font was resolved.
            // We can override the fallback font.
            args.setResolvedFontName("Arial");
        }

        // Or simply substitute the specific font:
        if (Objects.equals(args.getRequestedFontName(), "Comic Sans MS")) {
            args.setResolvedFontName("Arial");
        }
    }
});

project.save("Output.pdf", so);
Related issue: TASKSNET-2596 - Add support for “Calculation for task and group summary rows” custom field option

The API for Extended attributes were improved. The previous ExtendedAttributeDefinition API where ExtendedAttributeDefinition.CalculationType should be one of the following: { None, Lookup, Rollup, Calculation } didn’t reflect all the cases such as extended attribute where values for leaf tasks are calculated using formula and values of the summary tasks are calculated using rollup. ExtendedAttributeDefinition.SummaryRowsCalculationType property (with values None, Rollup, UseFormula) was added to reflect MS Project’s model of extended attribute’s settings. ExtendedAttributeDefinition.CalculationType’s values are now limited to (None, Lookup, Formula) values.

Extended attribute settings in MS Project The following example creates an extended attribute which values for leaf tasks are calculated using formula and values for summary tasks are calculated using average rollup:

Project project = new Project("Test.mpp");
ExtendedAttributeDefinition definition = ExtendedAttributeDefinition.createTaskDefinition(ExtendedAttributeTask.Cost1, "Calculated cost");
definition.setCalculationType(CalculationType.Formula);
definition.setFormula("[Cost] * 3.14");
definition.setSummaryRowsCalculationType(SummaryRowsCalculationType.Rollup);
definition.setRollupType(RollupType.Average);

project.getExtendedAttributes().add(definition);

project.save("Output.mpp");
Related issue: TASKSNET-10496 - Make WorkingTime immutable

In order to optimize calendar-related calculations WorkingTime class was made immutable (so properties cannot be modified after object is created). Also 2 new overloads of constructor of WorkingTime class were added to allow less verbose creation of WorkingTime:

22.3 version:

WorkingTime wt = new WorkingTime(
    new GregorianCalendar(1, Calendar.JANUARY, 1, 9, 0, 0).getTime(),
    new GregorianCalendar(1, Calendar.JANUARY, 1, 12, 0, 0).getTime()
);
WorkingTime wt2 = new WorkingTime(
    new GregorianCalendar(1, Calendar.JANUARY, 1, 9, 15, 0).getTime(),
    new GregorianCalendar(1, Calendar.JANUARY, 1, 12, 15, 0).getTime()
);
22.4+ version:
WorkingTime wt = new WorkingTime(9, 12);
// Calculate time of the day in milliseconds using formula:
// (hours * 3600 + minutes * 60 + seconds) * 1000.0
WorkingTime wt2 = new WorkingTime(
    (9 * 3600 + 15 * 60) * 1000.0,
    (12 * 3600 + 15 * 60) * 1000.0
);