}
@Override
protected RuleResult executeEnrolmentWithRulesAndTemporaryEnrolment(final ICurricularRule curricularRule,
final IDegreeModuleToEvaluate sourceDegreeModuleToEvaluate, final EnrolmentContext enrolmentContext) {
final CurricularCourse curricularCourse = (CurricularCourse) curricularRule.getDegreeModuleToApplyRule();
final ExecutionSemester executionSemester = enrolmentContext.getExecutionPeriod();
if (!curricularCourse.hasAnyActiveContext(enrolmentContext.getExecutionPeriod())) {
return RuleResult.createNA(sourceDegreeModuleToEvaluate.getDegreeModule());
}
if (isApproved(enrolmentContext, curricularCourse, executionSemester.getPreviousExecutionPeriod())) {
if (sourceDegreeModuleToEvaluate.isEnroled()) {
return RuleResult.createImpossible(sourceDegreeModuleToEvaluate.getDegreeModule(),
"curricularRules.ruleExecutors.AssertUniqueApprovalInCurricularCourseContextsExecutor.already.approved",
curricularCourse.getName());
} else {
return RuleResult.createFalse(sourceDegreeModuleToEvaluate.getDegreeModule(),
"curricularRules.ruleExecutors.AssertUniqueApprovalInCurricularCourseContextsExecutor.already.approved",
curricularCourse.getName());
}
} else if (hasEnrolmentWithEnroledState(enrolmentContext, curricularCourse,
executionSemester.getPreviousExecutionPeriod())) {
return RuleResult.createTrue(EnrolmentResultType.TEMPORARY, sourceDegreeModuleToEvaluate.getDegreeModule());