HttpServletResponse response) throws FenixServiceException {
final PhdProgramCandidacyProcessBean bean = getCreateCandidacyProcessBean();
request.setAttribute("createCandidacyBean", bean);
final ChoosePersonBean choosePersonBean = getCreateCandidacyProcessBean().getChoosePersonBean();
if (!choosePersonBean.hasPerson()) {
if (choosePersonBean.isFirstTimeSearch()) {
final Collection<Person> persons = Person.findPersonByDocumentID(choosePersonBean.getIdentificationNumber());
choosePersonBean.setFirstTimeSearch(false);
if (showSimilarPersons(choosePersonBean, persons)) {
RenderUtils.invalidateViewState();
return mapping.findForward("searchPerson");
}
}
bean.setPersonBean(new PersonBean(choosePersonBean.getName(), choosePersonBean.getIdentificationNumber(),
choosePersonBean.getDocumentType(), choosePersonBean.getDateOfBirth()));
return mapping.findForward("createCandidacy");
} else {
bean.setPersonBean(new PersonBean(bean.getChoosePersonBean().getPerson()));