Skip to content

Commit

Permalink
Merge pull request #1665 from ricardorcr/acceptedCandidacySignal/ACDM…
Browse files Browse the repository at this point in the history
…-1786

Enabling different actions when candidacy is accepted ACDM-1786 #resolve
  • Loading branch information
Luis-Cruz authored Sep 11, 2020
2 parents 0e2ac9a + f37a7aa commit b38a386
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@
import org.fenixedu.academic.util.Bundle;
import org.fenixedu.bennu.core.domain.Bennu;
import org.fenixedu.bennu.core.i18n.BundleUtil;
import org.fenixedu.bennu.core.signals.Signal;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.joda.time.YearMonthDay;

abstract public class IndividualCandidacy extends IndividualCandidacy_Base {

public final static String ACCEPTED = "candidacy.accepted";

protected IndividualCandidacy() {
super();
super.setWhenCreated(new DateTime());
Expand Down Expand Up @@ -206,6 +209,14 @@ public boolean isFor(final ExecutionInterval executionInterval) {
return getCandidacyProcess() != null && getCandidacyProcess().isFor(executionInterval);
}

@Override
public void setState(IndividualCandidacyState state) {
super.setState(state);
if (state == IndividualCandidacyState.ACCEPTED) {
Signal.emit(ACCEPTED, this);
}
}

protected boolean isCandidacyResultStateValid(final IndividualCandidacyState state) {
return state == IndividualCandidacyState.ACCEPTED || state == IndividualCandidacyState.REJECTED;
}
Expand Down

0 comments on commit b38a386

Please sign in to comment.