HasDependencies predecessor=(Task)implMap.get(pt);
HasDependencies successor=(Task)implMap.get(st);
if (predecessor==null) predecessor=new TaskLinkReferenceImpl(pt.getUniqueId(),pt.getProject());
if (successor==null) successor=new TaskLinkReferenceImpl(st.getUniqueId(),st.getProject());
Dependency d=Dependency.getInstance(predecessor, successor, dependency.getDependencyType(), dependency.getLag());
d.setDirty(true);
predecessor.getDependencyList(false).add(d);
successor.getDependencyList(true).add(d);
predecessors.remove(d);
}
for (Dependency dependency : predecessors) {
TaskLinkReference pt=(TaskLinkReference)dependency.getPredecessor();
TaskLinkReference st=(TaskLinkReference)dependency.getSuccessor();
TaskLinkReference predecessor=(TaskLinkReference)implMap.get(pt);
TaskLinkReference successor=(TaskLinkReference)implMap.get(st);
if (predecessor==null) predecessor=new TaskLinkReferenceImpl(pt.getUniqueId(),pt.getProject());
if (successor==null) successor=new TaskLinkReferenceImpl(st.getUniqueId(),st.getProject());
Dependency d=Dependency.getInstance(predecessor, successor, dependency.getDependencyType(), dependency.getLag());
d.setDirty(true);
predecessor.getDependencyList(false).add(d);
successor.getDependencyList(true).add(d);
//successors.remove(d);
}
}else{
for (Dependency dependency : predecessors) {
if (successors.contains(dependency)){
Task predecessor=(Task)implMap.get(dependency.getPredecessor());
Task successor=(Task)implMap.get(dependency.getSuccessor());
if (predecessor!=null&&successor!=null){
Dependency d=Dependency.getInstance(predecessor, successor, dependency.getDependencyType(), dependency.getLag());
d.setDirty(true);
//Serializer.connectDependency(dependency, predecessor, successor);
predecessor.getDependencyList(false).add(d);
successor.getDependencyList(true).add(d);
}
}