CurriculumGroup curriculumGroup = (CurriculumGroup) FenixFramework.getDomainObject(destinationCurriculumGroupID);
StudentCurricularPlan studentCurricularPlan = curriculumGroup.getStudentCurricularPlan();
for (final String enrollmentIDToTransfer : enrollmentIDsToTransfer) {
Enrolment enrolment = (Enrolment) FenixFramework.getDomainObject(enrollmentIDToTransfer);
fixEnrolmentCurricularCourse(studentCurricularPlan, enrolment);
enrolment.setCurriculumGroup(curriculumGroup);
enrolment.setStudentCurricularPlan(null);
}
} else {
final StudentCurricularPlan studentCurricularPlan =
FenixFramework.getDomainObject(destinationStudentCurricularPlanId);
for (final String enrollmentIDToTransfer : enrollmentIDsToTransfer) {
final Enrolment enrollment = (Enrolment) FenixFramework.getDomainObject(enrollmentIDToTransfer);
fixEnrolmentCurricularCourse(studentCurricularPlan, enrollment);
if (enrollment.getStudentCurricularPlan() != studentCurricularPlan) {
enrollment.setStudentCurricularPlan(studentCurricularPlan);
enrollment.setCurriculumGroup(null);
}
}
}
}