P6 Zero Duration Tasks and Percent Complete

There appears to be bug introduced in Aspose.Tasks .NET 22.9. The Percent Complete for an unstarted task with zero duration is being set to 100%.

In the attached sample file task “A1130” has the following attributes in P6:

  • Original Duration = 0 h
  • Actual Start & Actual Finish = blank
  • Duration % = 0%
  • Activity Type = Task Dependent
  • Resource assigned

In the Aspose task object, the PercentComplete = 100.

P6 Screenshot:
image.png (49.1 KB)

P6 Project
Birthday Party.zip (5.3 KB)

Sample Program:

Project m_Project2 = new Project(fileName2);
      ChildTasksCollector m_coll2 = new ChildTasksCollector();
       TaskUtils.Apply(m_Project2.RootTask, m_coll2, 0);
      foreach (var tsk in m_coll2.Tasks) {
         if (tsk.Get(Tsk.ActivityId) == "A1130") {
               Console.WriteLine($"Id: {tsk.Get(Tsk.Id)} \n" +
                   $"Uid: {tsk.Get(Tsk.Uid)} \n" +
                   $"Name: {tsk.Get(Tsk.Name)} \n" +
                   $"Start: {tsk.Get(Tsk.Start)} \n" +
                   $"Finish: {tsk.Get(Tsk.Finish)} \n" +
                   $"Duration: {tsk.Get(Tsk.Duration)} \n" +
                   $"ActualStart: {tsk.Get(Tsk.ActualStart)} \n" +
                   $"ActualFinish: {tsk.Get(Tsk.ActualFinish)} \n" +
                   $"PercentComplete: {tsk.Get(Tsk.PercentComplete)} \n");
           }
       }

Program Output 22.10
image.png (13.6 KB)

Program Output 22.9
image.png (7.3 KB)

Program Output 22.8
image.png (7.2 KB)

@leglandpalisade,
thank you for attached sample file and code snippet.
We’ve reproduced the issue.
The fix will be released in version 22.11.

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