Resource Leveling - During recalculation or via method call?

Does Aspose.Tasks support the concept of Resource Leveling? I’ve done some testing with a small sample project and it does not appear to resource leveling during a standard recalculation, even if the original Microsoft Project file has the Resource Leveling options set to Automatic.

Behavior in MS Project:

  • Simple project with four tasks.
  • Resource Leveling option set to Automatic
  • Tasks 3 & 4 are both assigned to Resource 1.
  • There is no predecessor relationship between Tasks 3 & 4.
  • Modifying Task 3 duration from 1 to 10. Resource 1 is flagged as overallocated.
  • Task 4 start date is pushed out by 9 days.

Behavior in Aspose:

  • Open simple project with four tasks. (referenced above)
  • Project calculation mode is set to Automatic.
  • Programmatically modify Task 3 duration from 1 to 10.
  • Recalculate
  • Overallocated flag on Resource 1 is still false
  • StartDate for Task 4 did not get adjusted.

Code sample:

        Project OriginalProject = new Project(@"C:\SingleTask.mpp") {
        };
       
        var collector = new ChildTasksCollector();
        TaskUtils.Apply(OriginalProject.RootTask, collector, 0);
                    
        OriginalProject.CalculationMode = CalculationMode.Automatic;

        foreach (var tsk in collector.Tasks) {
            if (tsk.Get(Tsk.Uid) >= 6) {
                Console.WriteLine(" ");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Uid), "Uid");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Name), "Name");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Start), "Start");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Finish), "Finish");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Duration), "Duration");
            }
        }

        foreach (var tsk in collector.Tasks) {
            if (tsk.Get(Tsk.Uid) == 7) {
                tsk.Set(Tsk.Duration, OriginalProject.GetDuration(10, tsk.Get(Tsk.DurationFormat)));
            }
        }

        Console.WriteLine("");

        OriginalProject.Recalculate();
        //OriginalProject.RecalculateResourceFields();
        //OriginalProject.RecalculateResourceStartFinish();

        foreach (var tsk in collector.Tasks) {
            if (tsk.Get(Tsk.Uid) >= 6) {
                Console.WriteLine(" ");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Uid), "Uid");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Name), "Name");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Start), "Start");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Finish), "Finish");
                Console.WriteLine("{0} {1}", tsk.Get(Tsk.Duration), "Duration");
            }
        }

SingleTask (2).zip (36.0 KB)

Is there something I’m missing in my setup/processing?

@leglandpalisade

I regret to share that at present the request support is unavailable in API. A ticket with ID TASKSNET-4522 has already been created to provide the requested support. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

The issues you have found earlier (filed as TASKSNET-4522) have been fixed in this update.
Download link : Downloads ---New Releases-aspose.tasks-for-.net-24.6-(dlls-only)