Package org.fenixedu.academic.domain.curricularRules

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


    }

    @Override
    public Set<ICurricularRule> getCurricularRules(ExecutionSemester executionSemester) {
        final Set<ICurricularRule> result = super.getCurricularRules(executionSemester);
        result.add(new CreditsLimitInExternalCycle(getRootCurriculumGroup().getCycleCurriculumGroup(
                getCycleType().getSourceCycleAffinity()), this));

        return result;
    }
View Full Code Here


    }

    @Override
    protected RuleResult executeEnrolmentWithRulesAndTemporaryEnrolment(ICurricularRule curricularRule,
            IDegreeModuleToEvaluate sourceDegreeModuleToEvaluate, EnrolmentContext enrolmentContext) {
        final CreditsLimitInExternalCycle creditsLimitInExternalCycle = (CreditsLimitInExternalCycle) curricularRule;
        final ExternalCurriculumGroup externalCurriculumGroup = creditsLimitInExternalCycle.getExternalCurriculumGroup();

        if (!isToApply(sourceDegreeModuleToEvaluate, enrolmentContext, externalCurriculumGroup)) {
            return RuleResult.createNA(sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        if (isEnrolingDissertation(enrolmentContext, externalCurriculumGroup)) {
            return createRuleResultForEnrolingDissertation(sourceDegreeModuleToEvaluate, creditsLimitInExternalCycle);
        }

        final CycleCurriculumGroup previousCycleCurriclumGroup = creditsLimitInExternalCycle.getPreviousCycleCurriculumGroup();
        final Double totalCreditsInPreviousCycle = previousCycleCurriclumGroup.getAprovedEctsCredits();

        if (!creditsLimitInExternalCycle.creditsInPreviousCycleSufficient(totalCreditsInPreviousCycle)) {
            return createRuleResultForNotSatisfiedCreditsForPreviousCycle(sourceDegreeModuleToEvaluate,
                    creditsLimitInExternalCycle, previousCycleCurriclumGroup);
        }

        final Double totalCredits = calculateApprovedAndEnrollingTotalCredits(enrolmentContext, externalCurriculumGroup);
        if (creditsLimitInExternalCycle.creditsExceedMaximumInExternalCycle(totalCredits, totalCreditsInPreviousCycle)) {
            return createRuleResultForMaxCreditsExceededInExternalCycle(sourceDegreeModuleToEvaluate,
                    creditsLimitInExternalCycle, totalCredits, totalCreditsInPreviousCycle);
        }

        final Double totalEctsWithEnroledEctsCreditsFromPreviousPeriod =
                totalCredits
                        + externalCurriculumGroup.getEnroledEctsCredits(enrolmentContext.getExecutionPeriod()
                                .getPreviousExecutionPeriod());
        if (creditsLimitInExternalCycle.creditsExceedMaximumInExternalCycle(totalEctsWithEnroledEctsCreditsFromPreviousPeriod,
                totalCreditsInPreviousCycle)) {
            return RuleResult.createTrue(EnrolmentResultType.TEMPORARY, sourceDegreeModuleToEvaluate.getDegreeModule(),
                    "curricularRules.ruleExecutors.CreditsLimitInExternalCycleExecutor.external.cycle.limit.exceeded",
                    creditsLimitInExternalCycle.getExternalCurriculumGroup().getName().getContent(),
                    totalEctsWithEnroledEctsCreditsFromPreviousPeriod.toString(), creditsLimitInExternalCycle
                            .getMaxCreditsInExternalCycle(totalCreditsInPreviousCycle).toString(), totalCreditsInPreviousCycle
                            .toString());
        }

        return RuleResult.createTrue(sourceDegreeModuleToEvaluate.getDegreeModule());
View Full Code Here

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

        final CreditsLimitInExternalCycle creditsLimitInExternalCycle = (CreditsLimitInExternalCycle) curricularRule;
        final ExternalCurriculumGroup externalCurriculumGroup = creditsLimitInExternalCycle.getExternalCurriculumGroup();

        if (!isToApply(sourceDegreeModuleToEvaluate, enrolmentContext, externalCurriculumGroup)) {
            return RuleResult.createNA(sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        if (isEnrolingDissertation(enrolmentContext, externalCurriculumGroup)) {
            return createRuleResultForEnrolingDissertation(sourceDegreeModuleToEvaluate, creditsLimitInExternalCycle);
        }

        final CycleCurriculumGroup previousCycleCurriclumGroup = creditsLimitInExternalCycle.getPreviousCycleCurriculumGroup();
        final Double totalCreditsInPreviousCycle = previousCycleCurriclumGroup.getAprovedEctsCredits();

        if (!creditsLimitInExternalCycle.creditsInPreviousCycleSufficient(totalCreditsInPreviousCycle)) {
            return createRuleResultForNotSatisfiedCreditsForPreviousCycle(sourceDegreeModuleToEvaluate,
                    creditsLimitInExternalCycle, previousCycleCurriclumGroup);
        }

        final Double totalCreditsInExternalCycle =
                calculateApprovedAndEnrollingTotalCredits(enrolmentContext, externalCurriculumGroup);
        if (creditsLimitInExternalCycle.creditsExceedMaximumInExternalCycle(totalCreditsInExternalCycle,
                totalCreditsInPreviousCycle)) {
            return createRuleResultForMaxCreditsExceededInExternalCycle(sourceDegreeModuleToEvaluate,
                    creditsLimitInExternalCycle, totalCreditsInExternalCycle, totalCreditsInPreviousCycle);
        }
View Full Code Here

TOP

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

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.