throw new ValidationException(
_("Source and destination scenarios should be different"));
}
orderDAO.save(order);
OrderVersion sourceOrderVersion = order
.getOrderVersionFor(sourceScenario);
if (sourceOrderVersion == null) {
throw new RuntimeException(
"Project version must not be null for source scenario");
}
OrderVersion destinationOrderVersion = order
.getOrderVersionFor(destinationScenario);
if ((destinationOrderVersion != null)
&& (sourceOrderVersion.getId().equals(destinationOrderVersion
.getId()))) {
throw new ValidationException(
_("Project version is the same in source and destination scenarios"));
}
order.useSchedulingDataFor(sourceOrderVersion);
OrderVersion newOrderVersion = OrderVersion
.createInitialVersion(destinationScenario);
order.setOrderVersion(destinationScenario, newOrderVersion);
order
.writeSchedulingDataChangesTo(destinationScenario,
newOrderVersion);