Package org.fenixedu.academic.domain.curricularRules

Examples of org.fenixedu.academic.domain.curricularRules.MinimumNumberOfCreditsToEnrol


    @Override
    protected RuleResult executeEnrolmentVerificationWithRules(final ICurricularRule curricularRule,
            final IDegreeModuleToEvaluate sourceDegreeModuleToEvaluate, final EnrolmentContext enrolmentContext) {

        final MinimumNumberOfCreditsToEnrol rule = (MinimumNumberOfCreditsToEnrol) curricularRule;
        if (!canApplyRule(enrolmentContext, curricularRule)) {
            return RuleResult.createNA(sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        final Double totalEctsCredits =
                getTotalEctsCredits(enrolmentContext.getStudentCurricularPlan().getRoot(), enrolmentContext.getExecutionPeriod()
                        .getExecutionYear());

        if (rule.allowCredits(totalEctsCredits)) {
            return RuleResult.createTrue(sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        if (sourceDegreeModuleToEvaluate.isEnroled() && sourceDegreeModuleToEvaluate.isLeaf()) {
            return createImpossibleRuleResult(rule, totalEctsCredits, sourceDegreeModuleToEvaluate);
View Full Code Here


    @Override
    protected RuleResult executeEnrolmentWithRulesAndTemporaryEnrolment(final ICurricularRule curricularRule,
            final IDegreeModuleToEvaluate sourceDegreeModuleToEvaluate, final EnrolmentContext enrolmentContext) {

        final MinimumNumberOfCreditsToEnrol rule = (MinimumNumberOfCreditsToEnrol) curricularRule;
        if (!canApplyRule(enrolmentContext, curricularRule)) {
            return RuleResult.createNA(sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        final CurriculumGroup curriculumGroup = enrolmentContext.getStudentCurricularPlan().getRoot();
        Double totalEctsCredits = curriculumGroup.getAprovedEctsCredits();

        if (rule.allowCredits(totalEctsCredits)) {
            return RuleResult.createTrue(sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        final ExecutionSemester previousExecutionPeriod = enrolmentContext.getExecutionPeriod().getPreviousExecutionPeriod();
        totalEctsCredits =
                Double.valueOf(totalEctsCredits.doubleValue()
                        + curriculumGroup.getEnroledEctsCredits(previousExecutionPeriod).doubleValue());

        if (rule.allowCredits(totalEctsCredits)) {
            return RuleResult.createTrue(EnrolmentResultType.TEMPORARY, sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        if (sourceDegreeModuleToEvaluate.isEnroled() && sourceDegreeModuleToEvaluate.isLeaf()) {
            return createImpossibleRuleResult(rule, totalEctsCredits, sourceDegreeModuleToEvaluate);
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.curricularRules.MinimumNumberOfCreditsToEnrol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.