Hi,
Please run the code as below:
public static void main(String[] args) throws ParseException {
FileInputStream fstream = null;
try {
// Create a stream object containing the license file
fstream = new FileInputStream("Aspose.Tasks.lic");
// Instantiate the License class
License license = new License();
// Set the license through the stream object
license.setLicense(fstream);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
fstream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Project asProject = new Project("Task-Assignment-Test.mpp");
com.aspose.tasks.Task asTaskUID_2 = asProject.getRootTask().getChildren().getByUid(2);
com.aspose.tasks.Task asTaskUID_3 = asProject.getRootTask().getChildren().getByUid(3);
System.out.println(asTaskUID_2.get(Tsk.START));
System.out.println(asTaskUID_3.get(Tsk.START));
asTaskUID_2.set(Tsk.DURATION, asProject.getDuration(4, TimeUnitType.Day));
System.out.println(asTaskUID_2.get(Tsk.START));
System.out.println(asTaskUID_3.get(Tsk.START));
asProject.save("output_change_duration.mpp", SaveFileFormat.MPP);
}
At the beginning, the "Start" of asTaskUID_2 and asTaskUID_3 are both "1/30/2005', then I changed the "Duration" of asTaskUID_2, why the "Start" of asTaskUID_2 and asTaskUID_3 trun to "5/25/2005"?
zhencheng.guo
Best Regards!