final IDegreeModuleToEvaluate degreeModuleToEvaluate = searchDegreeModuleToEvaluate(enrolmentContext, rule);
if (degreeModuleToEvaluate.isEnroled()) {
final EnroledCurriculumModuleWrapper moduleEnroledWrapper = (EnroledCurriculumModuleWrapper) degreeModuleToEvaluate;
final CourseGroup courseGroup = rule.getDegreeModuleToApplyRule();
final CurriculumGroup curriculumGroup = (CurriculumGroup) moduleEnroledWrapper.getCurriculumModule();
int total = countTotalDegreeModules(enrolmentContext, courseGroup, curriculumGroup);
if (rule.numberOfDegreeModulesExceedMaximum(total)) {
if (sourceDegreeModuleToEvaluate.isEnroled() && sourceDegreeModuleToEvaluate.isLeaf()) {