public void updateSituationOnPHDCandidacy() {
    PhdProgramCandidacyProcess process = getProcess();

    if (this.getStateDate() == null) {
      throw new DomainException("state.date.null");
    }

    PHDProgramCandidacy candidacy = process.getCandidacy();
    CandidacySituation situation = null;

    switch (this.getType()) {
      case PRE_CANDIDATE:
        situation = new PreCandidacySituation(candidacy);
        break;
      case STAND_BY_WITH_MISSING_INFORMATION:
      case STAND_BY_WITH_COMPLETE_INFORMATION:
        situation = new StandByCandidacySituation(candidacy);
        break;
      case CONCLUDED:
        situation = new AdmittedCandidacySituation(candidacy);
        break;
      case REJECTED:
        situation = new NotAdmittedCandidacySituation(candidacy);
        break;
      default:
    }

    if (situation != null) {
      situation.setSituationDate(this.getStateDate());
    }
  }