Problem with duration after percent change

Hello!
The problem is that after I perform a task percent change, and save the file, I could notice:

  1. the duration goes from work days to simple day and wrong
  2. if the duration is null then base start date and base finish date to reset.
    My program code (Java):
    FileInputStream fs = new FileInputStream(inp.MppFileName);
    existingProject = new Project(fs);
    fs.close();
    ChildTasksCollector collector = new ChildTasksCollector();
    TaskUtils.apply(existingProject.getRootTask(), collector, 0);
    java.util.List tasks = collector.getTasks();
    for (int i = 0; i < tasks.size(); i++) {
    Task tsk = tasks.get(i);
    if (inp.Guid.equalsIgnoreCase(tsk.get(Tsk.GUID))) {
    tsk.set(Tsk.PERCENT_COMPLETE, inp.Percent);
    existingProject.save(mppOutputFile, SaveFileFormat.MPP);
    return;
    }
    }
    Could you help me with this?
    Thank you in advance,
    Best Regards
    Valery Zinoviev
    order 180907083503.

@zinovev

It is requested to kindly share sample project file with us so that we could investigate in detail.

Moreover, You may share confidential files in a private message and the files shared in private message shall only be accessible to Aspose staff. For this purpose, please find “Message” button by clicking on my name.

Hello!

This is my MPP-file.

Content:

  • yellow – my change (from 0% to 1%);
  • red – reset to null;
  • green – set from 685 days to 2306 days;
  • blue – set from 151 wdays to 453 days

Thank you in advance,
Best Regards
Valery Zinoviev

@zinovev

Thank you for your feedback.

We are unable to reproduce this issue using the code sample provided with latest version of our API i.e. Aspose.Tasks for Java 18.11. We see no change in days.

Moreover, you may get more details for setting the duration of task in days at the link given below:
https://docs.aspose.com/display/tasksjava/Managing+Durations

Furthermore, it is requested to please share more details in this regard like the input MPP file and the output MPP or some screenshots highlighting the wrong information for detailed investigation.