Bug #1442: Fix regression.

FEA: ItEr76S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2012-05-10 12:09:00 +02:00
parent 8bfe22bf57
commit 2a1e7d3db6

View file

@ -299,7 +299,7 @@ public abstract class OrderElement extends IntegrationEntity implements
//we have to remove the TaskSource which contains a TaskGroup instead of TaskElement
removeTaskSource(result);
}
if(currentTaskSourceIsNotTheSame()) {
if (hadATaskSource() && currentTaskSourceIsNotTheSame()) {
//this element was unscheduled and then scheduled again. Its TaskSource has
//been recreated but we have to remove the old one.
if(!getParent().currentTaskSourceIsNotTheSame()) {
@ -316,7 +316,7 @@ public abstract class OrderElement extends IntegrationEntity implements
if (wasASchedulingPoint()) {
result.add(taskSourceRemoval());
}
if(currentTaskSourceIsNotTheSame()) {
if (hadATaskSource() && currentTaskSourceIsNotTheSame()) {
//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.
if(getParent() == null || !getParent().currentTaskSourceIsNotTheSame()) {
@ -356,6 +356,10 @@ public abstract class OrderElement extends IntegrationEntity implements
return getOnDBTaskSource() != getTaskSource();
}
protected boolean hadATaskSource() {
return getOnDBTaskSource() != null;
}
private List<TaskSourceSynchronization> childrenSynchronizations() {
List<TaskSourceSynchronization> childrenOfGroup = new ArrayList<TaskSourceSynchronization>();
for (OrderElement orderElement : getSomewhatScheduledOrderElements()) {