ActionForward actionForwardError = verifySubmissionPreconditions(mapping);
if (actionForwardError != null) {
return actionForwardError;
}
SecondCycleIndividualCandidacyProcessBean bean =
(SecondCycleIndividualCandidacyProcessBean) getIndividualCandidacyProcessBean();
bean.setInternalPersonCandidacy(Boolean.TRUE);
boolean isValid = hasInvalidViewState();
if (!isValid) {
invalidateDocumentFileRelatedViewStates();
request.setAttribute(getIndividualCandidacyProcessBeanName(), getIndividualCandidacyProcessBean());
return mapping.findForward("candidacy-continue-creation");
}
List<Degree> degreeList = new ArrayList<Degree>(bean.getSelectedDegreeList());
if (candidacyIndividualProcessExistsForThisEmail(bean.getPersonBean().getEmail(), degreeList)) {
addActionMessage("error", request, "error.candidacy.hash.code.already.bounded");
invalidateDocumentFileRelatedViewStates();
request.setAttribute(getIndividualCandidacyProcessBeanName(), getIndividualCandidacyProcessBean());
return mapping.findForward("candidacy-continue-creation");
}
if (!bean.getHonorAgreement()) {
addActionMessage("error", request, "error.must.agree.on.declaration.of.honor");
invalidateDocumentFileRelatedViewStates();
request.setAttribute(getIndividualCandidacyProcessBeanName(), getIndividualCandidacyProcessBean());
return mapping.findForward("candidacy-continue-creation");
}
if (bean.getSelectedDegreeList().isEmpty()) {
addActionMessage("error", request, "error.must.select.at.least.one.degree");
invalidateDocumentFileRelatedViewStates();
request.setAttribute(getIndividualCandidacyProcessBeanName(), getIndividualCandidacyProcessBean());
return mapping.findForward("candidacy-continue-creation");
}