Bug #1387: Fix bug
Possible fix of the first problem. It looks into the SchedulingDataForVersion instead of the data to see the status in the database instead of in memory so the synchronizations sent to the database are ok.
This commit is contained in:
parent
e5f00bb8a1
commit
a20fc0ec1f
1 changed files with 11 additions and 6 deletions
|
|
@ -57,7 +57,6 @@ import org.libreplan.business.orders.entities.SchedulingState.Type;
|
|||
import org.libreplan.business.orders.entities.TaskSource.TaskSourceSynchronization;
|
||||
import org.libreplan.business.planner.entities.Task;
|
||||
import org.libreplan.business.planner.entities.TaskElement;
|
||||
import org.libreplan.business.planner.entities.TaskGroup;
|
||||
import org.libreplan.business.planner.entities.TaskPositionConstraint;
|
||||
import org.libreplan.business.qualityforms.entities.QualityForm;
|
||||
import org.libreplan.business.qualityforms.entities.TaskQualityForm;
|
||||
|
|
@ -291,7 +290,7 @@ public abstract class OrderElement extends IntegrationEntity implements
|
|||
SchedulingDataForVersion schedulingDataForVersion) {
|
||||
List<TaskSourceSynchronization> result = new ArrayList<TaskSourceSynchronization>();
|
||||
if (isSchedulingPoint()) {
|
||||
if(isSchedulingPointButItWasNot()) {
|
||||
if (itWasntSchedulingPoint()) {
|
||||
//this element was a container but now it's a scheduling point
|
||||
//we have to remove the TaskSource which contains a TaskGroup instead of TaskElement
|
||||
removeTaskSource(result);
|
||||
|
|
@ -329,9 +328,10 @@ public abstract class OrderElement extends IntegrationEntity implements
|
|||
&& getTaskSource().getTask() instanceof Task;
|
||||
}
|
||||
|
||||
private boolean isSchedulingPointButItWasNot() {
|
||||
return getTaskSource() != null
|
||||
&& getTaskSource().getTask() instanceof TaskGroup;
|
||||
private boolean itWasntSchedulingPoint() {
|
||||
SchedulingDataForVersion currentVersionOnDB = getCurrentVersionOnDB();
|
||||
return SchedulingState.Type.SCHEDULING_POINT != currentVersionOnDB
|
||||
.getSchedulingStateType();
|
||||
}
|
||||
|
||||
private List<TaskSourceSynchronization> childrenSynchronizations() {
|
||||
|
|
@ -417,11 +417,16 @@ public abstract class OrderElement extends IntegrationEntity implements
|
|||
}
|
||||
|
||||
private TaskSource getOnDBTaskSource() {
|
||||
SchedulingDataForVersion schedulingDataForVersion = getCurrentVersionOnDB();
|
||||
return schedulingDataForVersion.getTaskSource();
|
||||
}
|
||||
|
||||
SchedulingDataForVersion getCurrentVersionOnDB() {
|
||||
OrderVersion version = getCurrentSchedulingData()
|
||||
.getOriginOrderVersion();
|
||||
SchedulingDataForVersion schedulingDataForVersion = schedulingDatasForVersion
|
||||
.get(version);
|
||||
return schedulingDataForVersion.getTaskSource();
|
||||
return schedulingDataForVersion;
|
||||
}
|
||||
|
||||
private TaskSourceSynchronization taskSourceRemoval() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue