Hi,
When I try to set a parent task as predecessor with link type Finish to Finish, the dates are wrong.
Code:
Project project = new Project();
Task rootTask = project.getRootTask();
Task a = rootTask.getChildren().add(“A”);
a.set(Tsk.DURATION, project.getDuration(1d, TimeUnitType.Day));
Task b = a.getChildren().add(“B”);
b.set(Tsk.DURATION, project.getDuration(1d, TimeUnitType.Day));
Task c = a.getChildren().add(“C”);
c.set(Tsk.DURATION, project.getDuration(1d, TimeUnitType.Day));
Task d = project.getRootTask().getChildren().add(“D”);
d.set(Tsk.DURATION, project.getDuration(1d, TimeUnitType.Day));
project.getTaskLinks().add(b, c);
project.getTaskLinks().add(a, d, TaskLinkType.FinishToFinish);
Result:
1 | A | Wed Sep 09 08:00:00 BRT 2015 | Thu Sep 10 17:00:00 BRT 2015 | 2 days
2 | B | Wed Sep 09 08:00:00 BRT 2015 | Wed Sep 09 17:00:00 BRT 2015 | 1 day
3 | C | Thu Sep 10 08:00:00 BRT 2015 | Thu Sep 10 17:00:00 BRT 2015 | 1 day
4 | D | Wed Sep 09 08:00:00 BRT 2015 | Wed Sep 09 17:00:00 BRT 2015 | 1 day
The correct result is task D with start Thu Sep 10 08:00:00 BRT 2015 and finish Thu Sep 10 17:00:00 BRT 2015.