final EnroledCurriculumModuleWrapper moduleEnroledWrapper =
(EnroledCurriculumModuleWrapper) degreeModuleToEvaluate;
if (moduleEnroledWrapper.getCurriculumModule() instanceof Enrolment) {
final Enrolment enrolment = (Enrolment) moduleEnroledWrapper.getCurriculumModule();
enrolment.setEnrolmentCondition(getEnrolmentCondition(enrolment, entry.getKey()));
}
} else {
final DegreeModule degreeModule = degreeModuleToEvaluate.getDegreeModule();
final CurriculumGroup curriculumGroup = degreeModuleToEvaluate.getCurriculumGroup();
if (degreeModule.isLeaf()) {
if (degreeModuleToEvaluate.isOptional()) {
createOptionalEnrolmentFor(getEnrolmentCondition(null, entry.getKey()), degreeModuleToEvaluate,
curriculumGroup);
} else {
new Enrolment(getStudentCurricularPlan(), curriculumGroup, (CurricularCourse) degreeModule,
getExecutionSemester(), getEnrolmentCondition(null, entry.getKey()), createdBy);
}
} else {
CurriculumGroupFactory.createGroup(degreeModuleToEvaluate.getCurriculumGroup(),