}
public ActionForward enrolInOptionalCurricularCourse(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws FenixServiceException {
final BolonhaStudentOptionalEnrollmentBean optionalStudentEnrollmentBean =
getBolonhaStudentOptionalEnrollmentBeanFromViewState();
try {
final RuleResult ruleResults =
EnrolBolonhaStudent.run(optionalStudentEnrollmentBean.getStudentCurricularPlan(),
optionalStudentEnrollmentBean.getExecutionPeriod(),
buildOptionalDegreeModuleToEnrolList(optionalStudentEnrollmentBean),
Collections.<CurriculumModule> emptyList(), getCurricularRuleLevel(form));
if (ruleResults.isWarning()) {
addRuleResultMessagesToActionMessages("warning", request, ruleResults);
}
} catch (EnrollmentDomainException ex) {
addRuleResultMessagesToActionMessages("error", request, ex.getFalseResult());
request.setAttribute("optionalEnrolmentBean", optionalStudentEnrollmentBean);
return mapping.findForward("chooseOptionalCurricularCourseToEnrol");
} catch (DomainException ex) {
addActionMessage("error", request, ex.getKey(), ex.getArgs());
request.setAttribute("optionalEnrolmentBean", optionalStudentEnrollmentBean);
return mapping.findForward("chooseOptionalCurricularCourseToEnrol");
}
return prepareShowDegreeModulesToEnrol(mapping, form, request, response,
optionalStudentEnrollmentBean.getStudentCurricularPlan(), optionalStudentEnrollmentBean.getExecutionPeriod());
}