}
public ActionForward enrolInDegreeModules(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws FenixServiceException {
final BolonhaStudentEnrollmentBean bolonhaStudentEnrollmentBean = getBolonhaStudentEnrollmentBeanFromViewState();
try {
final RuleResult ruleResults =
EnrolBolonhaStudent.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);
}
enroledWithSuccess(request, bolonhaStudentEnrollmentBean);
} catch (EnrollmentDomainException ex) {
addRuleResultMessagesToActionMessages("error", request, ex.getFalseResult());
return prepareShowDegreeModulesToEnrol(mapping, form, request, response, bolonhaStudentEnrollmentBean);
} catch (DomainException ex) {
addActionMessage("error", request, ex.getKey(), ex.getArgs());
return prepareShowDegreeModulesToEnrol(mapping, form, request, response, bolonhaStudentEnrollmentBean);
}
RenderUtils.invalidateViewState();
return prepareShowDegreeModulesToEnrol(mapping, form, request, response,
bolonhaStudentEnrollmentBean.getStudentCurricularPlan(), bolonhaStudentEnrollmentBean.getExecutionPeriod());
}