public ActionForward createPhdEventExemption(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
try {
final PhdEventExemptionBean bean = getRenderedObject("exemptionBean");
if (bean.getJustificationType() == PhdEventExemptionJustificationType.PHD_GRATUITY_FCT_SCHOLARSHIP_EXEMPTION) {
PhdGratuityExternalScholarshipExemption.createPhdGratuityExternalScholarshipExemption(getLoggedPerson(request),
bean.getValue(), bean.getProvider(), (PhdGratuityEvent) bean.getEvent());
} else if (bean.getJustificationType() == PhdEventExemptionJustificationType.DIRECTIVE_COUNCIL_AUTHORIZATION) {
PhdEventExemption.create(getLoggedPerson(request), bean.getEvent(), bean.getValue(), bean.getJustificationType(),
bean.getDispatchDate(), bean.getReason());
} else if (bean.getJustificationType() == PhdEventExemptionJustificationType.FINE_EXEMPTION) {
PhdGratuityFineExemption.createPhdGratuityFineExemption(getLoggedPerson(request),
(PhdGratuityEvent) bean.getEvent(), bean.getReason());
}
} catch (DomainExceptionWithLabelFormatter ex) {
addActionMessage(request, ex.getKey(), solveLabelFormatterArgs(request, ex.getLabelFormatterArgs()));
return prepareCreatePhdEventExemptionInvalid(mapping, form, request, response);