ActionForward actionForwardError = verifySubmissionPreconditions(mapping);
if (actionForwardError != null) {
return actionForwardError;
}
DegreeTransferIndividualCandidacyProcessBean bean =
(DegreeTransferIndividualCandidacyProcessBean) getIndividualCandidacyProcessBean();
try {
boolean isValid = hasInvalidViewState();
if (!isValid) {
request.setAttribute(getIndividualCandidacyProcessBeanName(), getIndividualCandidacyProcessBean());
return mapping.findForward("edit-candidacy-habilitations");
}
IndividualCandidacyProcess individualCandidacyProcess = bean.getIndividualCandidacyProcess();
if (individualCandidacyProcess.getPersonalDetails().getPerson().getStudent() != null) {
bean.setPersonNumber(individualCandidacyProcess.getPersonalDetails().getPerson().getStudent().getNumber()
.toString());
}
if (isOrWasEnrolledInInstitution(bean)) {
addActionMessage("error", request, "error.degreeTransfer.is.or.was.enrolled.in.institution", Unit
.getInstitutionName().getContent());
request.setAttribute(getIndividualCandidacyProcessBeanName(), getIndividualCandidacyProcessBean());
return mapping.findForward("edit-candidacy-habilitations");
}
executeActivity(individualCandidacyProcess, "EditPublicCandidacyHabilitations", getIndividualCandidacyProcessBean());
} catch (final DomainException e) {
addActionMessage(request, e.getMessage(), e.getArgs());
request.setAttribute(getIndividualCandidacyProcessBeanName(), getIndividualCandidacyProcessBean());
return mapping.findForward("edit-candidacy-habilitations");
}
request.setAttribute("individualCandidacyProcess", bean.getIndividualCandidacyProcess());
return backToViewCandidacyInternal(mapping, form, request, response);
}