ItEr33S14CUCreacionUnidadesPlanificacion: Using task#getStartConstraints when calculating start date
This commit is contained in:
parent
46c87c23f0
commit
4feb07dd89
1 changed files with 6 additions and 11 deletions
|
|
@ -153,10 +153,13 @@ public class GanttDiagramGraph {
|
|||
}
|
||||
|
||||
private void enforceStartDate(Set<Dependency> incoming) {
|
||||
List<Constraint<Date>> startConstraints = Dependency
|
||||
List<Constraint<Date>> dependencyConstraints = Dependency
|
||||
.getStartConstraints(incoming);
|
||||
Date newStart = Constraint.apply(null,
|
||||
plusGlobalStartConstraints(startConstraints));
|
||||
Date newStart = Constraint.<Date> initialValue(null)
|
||||
.withConstraints(dependencyConstraints)
|
||||
.withConstraints(task.getStartConstraints())
|
||||
.withConstraints(globalStartConstraints)
|
||||
.apply();
|
||||
if (!task.getBeginDate().equals(newStart)) {
|
||||
task.setBeginDate(newStart);
|
||||
}
|
||||
|
|
@ -164,14 +167,6 @@ public class GanttDiagramGraph {
|
|||
|
||||
}
|
||||
|
||||
private List<Constraint<Date>> plusGlobalStartConstraints(
|
||||
List<Constraint<Date>> startConstraints) {
|
||||
List<Constraint<Date>> result = new ArrayList<Constraint<Date>>();
|
||||
result.addAll(startConstraints);
|
||||
result.addAll(globalStartConstraints);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void enforceAllRestrictions() {
|
||||
for (DependencyRulesEnforcer rulesEnforcer : rulesEnforcersByTask
|
||||
.values()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue