Examples of PhdDomainOperationException


Examples of org.fenixedu.academic.domain.phd.exceptions.PhdDomainOperationException

    }

    private void checkType(final PhdThesisProcess process, final PhdThesisProcessStateType type) {
        final PhdThesisProcessStateType currentType = process.getActiveState();
        if (currentType != null && currentType.equals(type)) {
            throw new PhdDomainOperationException("error.PhdThesisProcessState.equals.previous.state", type.getLocalizedName());
        }
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.exceptions.PhdDomainOperationException

        PhdThesisProcessState mostRecentState = process.getMostRecentState();

        switch (type) {
        case NEW:
            if (process.getWhenThesisDiscussionRequired() == null) {
                throw new PhdDomainOperationException(
                        "error.phd.thesis.PhdThesisProcessState.whenThesisDiscussionRequired.required");
            }

            stateDate = process.getWhenThesisDiscussionRequired().toDateTimeAtStartOfDay();
            break;
        case WAITING_FOR_JURY_CONSTITUTION:
            if (process.getWhenRequestJury() == null) {
                throw new PhdDomainOperationException("error.phd.thesis.PhdThesisProcessState.whenRequestJury.required");
            }

            stateDate = process.getWhenRequestJury().plusMinutes(1);
            break;
        case JURY_WAITING_FOR_VALIDATION:
            if (process.getWhenJuryDesignated() == null) {
                throw new PhdDomainOperationException("error.phd.thesis.PhdThesisProcessState.whenJuryDesignated.required");
            }

            stateDate = process.getWhenJuryDesignated().toDateTimeAtStartOfDay();
            break;
        case JURY_VALIDATED:
            if (process.getWhenJuryValidated() == null) {
                throw new PhdDomainOperationException("error.phd.thesis.PhdThesisProcessState.whenJuryValidated.required");
            }

            stateDate = process.getWhenJuryValidated().toDateTimeAtStartOfDay();
            break;
        case WAITING_FOR_JURY_REPORTER_FEEDBACK:
            stateDate = mostRecentState.getStateDate().plusMinutes(1);
            break;
        case WAITING_FOR_THESIS_MEETING_SCHEDULING:
            stateDate = mostRecentState.getStateDate().plusMinutes(1);
            break;
        case WAITING_FOR_THESIS_DISCUSSION_DATE_SCHEDULING:
            if (process.getMeetingDate() == null) {
                throw new PhdDomainOperationException("error.phd.thesis.PhdThesisProcessState.meetingDate.required");
            }

            stateDate = process.getMeetingDate();
            break;
        case THESIS_DISCUSSION_DATE_SCHECULED:
            stateDate = mostRecentState.getStateDate().plusMinutes(1);
            break;
        case WAITING_FOR_THESIS_RATIFICATION:
            if (process.getDiscussionDate() == null) {
                throw new PhdDomainOperationException("error.phd.thesis.PhdThesisProcessState.discussionDate.required");
            }

            stateDate = process.getDiscussionDate();
            break;
        case WAITING_FOR_FINAL_GRADE:
            if (process.getWhenFinalThesisRatified() == null) {
                throw new PhdDomainOperationException("error.phd.thesis.PhdThesisProcessState.whenFinalThesisRatified.required");
            }

            stateDate = process.getWhenFinalThesisRatified().toDateTimeAtStartOfDay();
            break;
        case CONCLUDED:
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.exceptions.PhdDomainOperationException

            Person person, String remarks, final DateTime stateDate) {
        List<PhdThesisProcessStateType> possibleNextStates = PhdThesisProcessStateType.getPossibleNextStates(process);

        if (!possibleNextStates.contains(type)) {
            String expectedStatesDescription = buildExpectedStatesDescription(possibleNextStates);
            throw new PhdDomainOperationException("phd.thesis.PhdThesisProcess.invalid.next.state", type.getLocalizedName(),
                    expectedStatesDescription);
        }

        return new PhdThesisProcessState(process, type, person, remarks, stateDate);
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.exceptions.PhdDomainOperationException

    }

    private void checkType(final PhdMeetingSchedulingProcess process, final PhdMeetingSchedulingProcessStateType type) {
        final PhdMeetingSchedulingProcessStateType currentType = process.getActiveState();
        if (currentType != null && currentType.equals(type)) {
            throw new PhdDomainOperationException("error.PhdMeetingSchedulingProcessState.equals.previous.state",
                    type.getLocalizedName());
        }
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.exceptions.PhdDomainOperationException

        PhdMeetingSchedulingProcessState mostRecentState = process.getMostRecentState();

        switch (type) {
        case WAITING_FIRST_THESIS_MEETING_REQUEST:
            if (process.getThesisProcess().getWhenJuryValidated() == null) {
                throw new PhdDomainOperationException(
                        "error.phd.thesis.meeting.PhdMeetingSchedulingProcessState.whenJuryValidated.required");
            }

            stateDate = process.getThesisProcess().getWhenJuryValidated().toDateTimeAtStartOfDay();
            break;
View Full Code Here

Examples of org.fenixedu.academic.domain.phd.exceptions.PhdDomainOperationException

        List<PhdMeetingSchedulingProcessStateType> possibleNextStates =
                PhdMeetingSchedulingProcessStateType.getPossibleNextStates(process);

        String expectedStatesDescription = buildExpectedStatesDescription(possibleNextStates);
        if (!possibleNextStates.contains(type)) {
            throw new PhdDomainOperationException("error.phd.thesis.meeting.PhdMeetingSchedulingProcessState.invalid.next.state",
                    type.getLocalizedName(), expectedStatesDescription);
        }

        return new PhdMeetingSchedulingProcessState(process, type, person, remarks, stateDate);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.