boolean runRules = false;
Person responsible = AccessControl.getPerson();
for (final CurriculumLineLocationBean curriculumLineLocationBean : moveCurriculumLinesBean.getCurriculumLineLocations()) {
final CurriculumGroup destination = curriculumLineLocationBean.getCurriculumGroup();
final CurriculumLine curriculumLine = curriculumLineLocationBean.getCurriculumLine();
if (curriculumLine.getCurriculumGroup() != destination) {
checkPermission(responsible, curriculumLineLocationBean);
if (!destination.canAdd(curriculumLine)) {
throw new DomainException("error.StudentCurricularPlan.cannot.move.curriculum.line.to.curriculum.group",
curriculumLine.getFullPath(), destination.getFullPath());
}
if (curriculumLine.hasExecutionPeriod()
&& curriculumLine.getExecutionYear().isBefore(destination.getRegistration().getStartExecutionYear())) {
throw new DomainException(
"error.StudentCurricularPlan.cannot.move.curriculum.line.to.curriculum.group.invalid.period",
curriculumLine.getFullPath(), destination.getFullPath(), curriculumLine.getExecutionPeriod()
.getQualifiedName(), destination.getRegistration().getStartExecutionYear().getQualifiedName());
}
if (!destination.isExtraCurriculum()) {
runRules = true;
}
curriculumLine.setCurriculumGroup(destination);
}
// if curriculum line is moved then change created by
curriculumLine.setCreatedBy(responsible != null ? responsible.getUsername() : curriculumLine.getCreatedBy());
}
runRules &= isBolonhaDegree();
if (runRules) {