The start time should be not greater than the finish one, exception when creating project from Primavera .xer file

Hello,
I created an application to convert Primavera (.xer) to MSProject, but sometimes I get a badly formatted file and as consequence, the Project (filename, exception handler) throws some exceptions.
My problems with the Project constructor are:

  1. No option to force the Project constructor to ignore the errors.
  2. The exception handler provided to the constructor is not fired.
    (Allowing to fix or ignore the error, or abort the process)
  3. The exception message is not enough to help me solve the problem with the file.
    (source line, task id, the field with an error, etc.)
    Example of one of the exception messages
    The start time should be not greater than the finish one.
    at Aspose.Tasks.WorkingTime.#=zm44tUkVUvAVN()
    at Aspose.Tasks.WorkingTime.set_FromTime(DateTime value)
    at Aspose.Tasks.WorkingTime…ctor(DateTime fromTime, DateTime toTime)
    at #=zvLIOtVtJUMebnByMuuljngVeyY35kPGlGLWI7gQ=.#=zqZP8EFU=(WeekDay #=zAccAtRE=, String #=zr2tqFGA=)
    at #=zvLIOtVtJUMebnByMuuljngVeyY35kPGlGLWI7gQ=.#=zgT44cHyJw2pK(Calendar #=z_IuzsqArJfgM30nOCg==, String #=zr2tqFGA=)
    at #=zvLIOtVtJUMebnByMuuljngVeyY35kPGlGLWI7gQ=.#=zWnDTap4=(#=zIldq6gZ83gCELeAzTO2a5$13DiSQaXzf$g== #=z_7eTKt4=)
    at #=zbQjZbutyTXydZSCk_eUXX9$MAzAI3ax2h2ObapZ0rhAy.#=zxOnjQv0=(StringReader #=zlnbk3_4=)
    at #=zbQjZbutyTXydZSCk_eUXX9$MAzAI3ax2h2ObapZ0rhAy.#=z7$r7Hj0=()
    at #=zbQjZbutyTXydZSCk_eUXX9$MAzAI3ax2h2ObapZ0rhAy.#=zWnDTap4=()
    at #=zbQjZbutyTXydZSCk_eUXX9$MAzAI3ax2h2ObapZ0rhAy.#=zWnDTap4=(Project #=z9Eg3fJg=, Stream #=zSYDskhQ=, Encoding #=zgFtdXMY=, ParseErrorCallback #=z8KSYnH16Bm3r)
    at #=zkT1d3U$5znmE6d4IzXTg06U=.#=zWnDTap4=(Stream #=zSYDskhQ=, Project #=z9Eg3fJg=)
    at Aspose.Tasks.Project.#=zg5eN4M7dHchh(Stream #=zSYDskhQ=, ParseErrorCallback #=z8KSYnH16Bm3r, Encoding #=zgFtdXMY=, PrimaveraXmlReadingOptions #=zXODHe2I=)
    at Aspose.Tasks.Project…ctor(String projectTemplate, ParseErrorCallback parseErrorHandler)
    at ConvertXlsxToMpp.Program.Main(String[] args) in E:\User\Mosaico\Ensemble\ConvertXerToMpp\ConvertXerToMpp\Program.cs:line 85

What I can do, through the Aspose Task library, to enable me to fix the data errors?

@ensemble

Can you please share the working sample code reproducing the issue on your end so that we may proceed further with investigation on our end.

Hi.

Here is the C# code(Console version) and attached the .xer file to allow you to reproduce the error.


using Aspose.Tasks;

using System;

namespace ConvertXerToMpp

{

class Program

{

static public object ImportHandlerError(object sender, ParseErrorArgs args)

{

Console.WriteLine("Object field: {0}, Object field type: {1}, Invalid value: {2}", args.FieldName, args.FieldType, args.InvalidValue);

return null;

}

static void Main(string[] args)

{

//License license = new Aspose.Tasks.License();

//license.SetLicense("Aspose.Tasks.NET.lic");

String fileName = @"202108 Quindanning FS Schedule.xer";

Project prj1 = null;

try

{

prj1 = new Project(fileName, ImportHandlerError);

}

catch (Exception e)

{

Console.WriteLine(e.Message);

Console.WriteLine(e.StackTrace);

}

}

}

}

image001.png (7.83 KB)

(Attachment 202108 Quindanning FS Schedule.xer is missing)

202108 Quindanning FS Schedule.zip (81.8 KB)

@ensemble

I have created a ticket with ID TASKSNET-10344 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Hi.

It’s the first time I use this forum. After marking the task as ‘Resolved’, will you send me a new version of the library?

Hi.

Could you please inform me what was the solution for my issue?

image001.png (7.83 KB)

@Jose_Curtt,

The issue has been marked as resolved in upcoming version 21.9. Please note that ParseErrorCallback is supported only for .XML format, but we will consider to add it for .XER format as well.

Mudassir Fayyaz.

When version 21.9 will be available?

My app is in production, so what I need now is some workaround to let the Aspose library finish the process of reading the XER file by applying default values if necessary.

Regards,

image001.png (7.83 KB)

The issues you have found earlier (filed as TASKSNET-10344) have been fixed in this update.