예제 #1
0
  private static void updateCandidateSituation(MasterDegreeCandidate masterDegreeCandidate) {
    masterDegreeCandidate.getActiveCandidateSituation().setValidation(new State(State.INACTIVE));

    CandidateSituation candidateSituation = new CandidateSituation();
    candidateSituation.setDate(Calendar.getInstance().getTime());
    candidateSituation.setMasterDegreeCandidate(masterDegreeCandidate);
    candidateSituation.setValidation(new State(State.ACTIVE));
    candidateSituation.setSituation(SituationName.ENROLLED_OBJ);
  }
예제 #2
0
  @Atomic
  public static InfoCandidateRegistration run(
      String candidateID, String branchID, Integer studentNumber, User userView)
      throws FenixServiceException {
    check(RolePredicates.MASTER_DEGREE_ADMINISTRATIVE_OFFICE_PREDICATE);
    MasterDegreeCandidate masterDegreeCandidate = FenixFramework.getDomainObject(candidateID);

    Person person = masterDegreeCandidate.getPerson();

    checkCandidateSituation(masterDegreeCandidate.getActiveCandidateSituation());

    // remove master degree candidate role
    person.removeRoleByType(RoleType.MASTER_DEGREE_CANDIDATE);

    // check if old student number is free
    checkOldStudentNumber(studentNumber, person);

    // create new student
    final ExecutionDegree executionDegree = masterDegreeCandidate.getExecutionDegree();
    Registration registration =
        createNewRegistration(person, studentNumber, executionDegree.getDegree());

    // person.addPersonRoles(Role.getRoleByRoleType(RoleType.STUDENT));

    StudentCurricularPlan studentCurricularPlan =
        createNewStudentCurricularPlan(registration, branchID, masterDegreeCandidate);

    // person.addPersonRoles(Role.getRoleByRoleType(RoleType.STUDENT));

    createEnrolments(userView, masterDegreeCandidate, studentCurricularPlan);

    updateCandidateSituation(masterDegreeCandidate);

    copyQualifications(masterDegreeCandidate, person);

    createGratuitySituation(masterDegreeCandidate, studentCurricularPlan);

    return createNewInfoCandidateRegistration(masterDegreeCandidate, studentCurricularPlan);
  }