// get or update person
Person person = getPerson(personBean);
// create candidacy
StudentCandidacy studentCandidacy =
StudentCandidacy.createStudentCandidacy(executionDegreeBean.getExecutionDegree(), person);
new RegisteredCandidacySituation(studentCandidacy, ingressionInformationBean.getRegistrationProtocol(),
executionDegreeBean.getCycleType(), ingressionInformationBean.getIngression(),
ingressionInformationBean.getEntryPhase(), personBean.getStudentNumber());
// create registration
Registration registration = studentCandidacy.getRegistration();
if (registration == null) {
registration =
Registration.createRegistrationWithCustomStudentNumber(person, executionDegreeBean.getDegreeCurricularPlan(),
studentCandidacy, ingressionInformationBean.getRegistrationProtocol(),
executionDegreeBean.getCycleType(), executionDegreeBean.getExecutionYear(),
personBean.getStudentNumber());
}
registration.setHomologationDate(ingressionInformationBean.getHomologationDate());
registration.setStudiesStartDate(ingressionInformationBean.getStudiesStartDate());
PersonalIngressionData personalIngressionData =
registration.getStudent().getPersonalIngressionDataByExecutionYear(
executionDegreeBean.getExecutionDegree().getExecutionYear());
if (personalIngressionData == null) {
personalIngressionData =
new PersonalIngressionData(originInformationBean, personBean, registration.getStudent(), executionDegreeBean
.getExecutionDegree().getExecutionYear());
} else {
personalIngressionData.edit(originInformationBean, personBean);
}
PrecedentDegreeInformation precedentDegreeInformation = studentCandidacy.getPrecedentDegreeInformation();
precedentDegreeInformation.edit(personalIngressionData, registration, precedentDegreeInformationBean, studentCandidacy);
// create qualification
new Qualification(person, precedentDegreeInformation);