public ActionForward unEnrol(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    Enrolment enrolment = readEnrolment(request);

    try {
      final RuleResult ruleResults =
          EnrolBolonhaStudent.run(
              readStudentCurricularPlan(request),
              enrolment.getExecutionPeriod(),
              new ArrayList<IDegreeModuleToEvaluate>(),
              Arrays.asList(new CurriculumModule[] {enrolment}),
              CurricularRuleLevel.ENROLMENT_NO_RULES);

      if (ruleResults.isWarning()) {
        addRuleResultMessagesToActionMessages("warning", request, ruleResults);
      }

    } catch (EnrollmentDomainException ex) {
      addRuleResultMessagesToActionMessages("error", request, ex.getFalseResult());
    } catch (DomainException ex) {
      addActionMessage("error", request, ex.getKey(), ex.getArgs());
    }

    return prepareSetEvaluations(mapping, actionForm, request, response);
  }
  public ActionForward enrolInDegreeModules(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws FenixServiceException {

    final BolonhaStudentEnrollmentBean bolonhaStudentEnrollmentBean =
        getBolonhaStudentEnrollmentBeanFromViewState();
    try {
      final RuleResult ruleResults =
          EnrolBolonhaStudentInCurriculumValidationContext.run(
              bolonhaStudentEnrollmentBean.getStudentCurricularPlan(),
              bolonhaStudentEnrollmentBean.getExecutionPeriod(),
              bolonhaStudentEnrollmentBean.getDegreeModulesToEvaluate(),
              bolonhaStudentEnrollmentBean.getCurriculumModulesToRemove(),
              bolonhaStudentEnrollmentBean.getCurricularRuleLevel());

      if (!bolonhaStudentEnrollmentBean.getDegreeModulesToEvaluate().isEmpty()
          || !bolonhaStudentEnrollmentBean.getCurriculumModulesToRemove().isEmpty()) {
        addActionMessage("success", request, "label.save.success");
      }

      if (ruleResults.isWarning()) {
        addRuleResultMessagesToActionMessages("warning", request, ruleResults);
      }

    } catch (EnrollmentDomainException ex) {
      addRuleResultMessagesToActionMessages("error", request, ex.getFalseResult());

      return prepareStudentEnrolment(mapping, form, request, response);

    } catch (DomainException ex) {
      addActionMessage("error", request, ex.getKey(), ex.getArgs());

      return prepareStudentEnrolment(mapping, form, request, response);
    }

    RenderUtils.invalidateViewState();

    return prepareStudentEnrolment(mapping, form, request, response);
  }