private double calculateTotalEctsCredits(final EnrolmentContext enrolmentContext) { double accumulated = 0d; for (final IDegreeModuleToEvaluate degreeModuleToEvaluate : enrolmentContext.getDegreeModulesToEvaluate()) { accumulated += degreeModuleToEvaluate.getAccumulatedEctsCredits(enrolmentContext.getExecutionPeriod()); } return accumulated; }
@Override protected RuleResult executeEnrolmentInEnrolmentEvaluation( final ICurricularRule curricularRule, final IDegreeModuleToEvaluate sourceDegreeModuleToEvaluate, final EnrolmentContext enrolmentContext) { return RuleResult.createNA(sourceDegreeModuleToEvaluate.getDegreeModule()); }
@Override protected RuleResult executeEnrolmentVerificationWithRules( final ICurricularRule curricularRule, final IDegreeModuleToEvaluate sourceDegreeModuleToEvaluate, final EnrolmentContext enrolmentContext) { final MaximumNumberOfEctsInStandaloneCurriculumGroup rule = (MaximumNumberOfEctsInStandaloneCurriculumGroup) curricularRule; final double total = calculateTotalEctsCredits(enrolmentContext) + calculateApprovedEcts(enrolmentContext); if (!rule.allowEcts(total)) { return RuleResult.createFalse( sourceDegreeModuleToEvaluate.getDegreeModule(), "curricularRules.ruleExecutors.MaximumNumberOfEctsInStandaloneCurriculumGroupExecutor", String.valueOf(rule.getMaximumEcts()), String.valueOf(total)); } return RuleResult.createTrue(sourceDegreeModuleToEvaluate.getDegreeModule()); }