Bug #1433: Make sure that old TaskSources are deleted also in the case of parent tasks.
It fixes the other part of the bug, when a task is the only child of a container and it is unscheduled, so the TaskSource of the parent is deleted too. FEA: ItEr76S04BugFixing
This commit is contained in:
parent
a25fac6146
commit
73b4f99e33
1 changed files with 12 additions and 2 deletions
|
|
@ -300,7 +300,12 @@ public abstract class OrderElement extends IntegrationEntity implements
|
|||
if(getOnDBTaskSource() != getTaskSource()) {
|
||||
//this element was unscheduled and then scheduled again. Its TaskSource has
|
||||
//been recreated but we have to remove the old one.
|
||||
removeTaskSource(result);
|
||||
if(getParent().getTaskSource() == getParent().getOnDBTaskSource()) {
|
||||
//we only remove the TaskSource if the parent is not in the same situation.
|
||||
//In case the parent is in the same situation, it will remove the related
|
||||
//TaskSources in children tasks.
|
||||
removeTaskSource(result);
|
||||
}
|
||||
}
|
||||
result
|
||||
.addAll(synchronizationForSchedulingPoint(schedulingDataForVersion));
|
||||
|
|
@ -309,6 +314,11 @@ public abstract class OrderElement extends IntegrationEntity implements
|
|||
if (wasASchedulingPoint()) {
|
||||
result.add(taskSourceRemoval());
|
||||
}
|
||||
if(getOnDBTaskSource() != getTaskSource()) {
|
||||
//all the children of this element were unscheduled and then scheduled again,
|
||||
//its TaskSource has been recreated but we have to remove the old one.
|
||||
result.add(taskSourceRemoval());
|
||||
}
|
||||
result
|
||||
.add(synchronizationForSuperelement(schedulingDataForVersion));
|
||||
} else if (schedulingState.isNoScheduled()) {
|
||||
|
|
@ -417,7 +427,7 @@ public abstract class OrderElement extends IntegrationEntity implements
|
|||
}
|
||||
}
|
||||
|
||||
private TaskSource getOnDBTaskSource() {
|
||||
protected TaskSource getOnDBTaskSource() {
|
||||
SchedulingDataForVersion schedulingDataForVersion = getCurrentVersionOnDB();
|
||||
return schedulingDataForVersion.getTaskSource();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue