if (!teacherBelongsToExecutionCourse(teacher, executionCourse)) {
if (!executionCourse.teacherLecturesExecutionCourse(teacher)) {
    public Boolean run(Integer executionCourseID, InfoSummary infoSummary) throws FenixServiceException,            ExcepcaoPersistencia {        if (infoSummary == null || infoSummary.getInfoShift() == null                || infoSummary.getInfoShift().getIdInternal() == null                || infoSummary.getIsExtraLesson() == null || infoSummary.getSummaryDate() == null) {            throw new FenixServiceException("error.summary.impossible.insert");        }        final ISuportePersistente persistentSupport = PersistenceSupportFactory                .getDefaultPersistenceSupport();        final IPersistentExecutionCourse persistentExecutionCourse = persistentSupport                .getIPersistentExecutionCourse();        final IExecutionCourse executionCourse = (IExecutionCourse) persistentExecutionCourse.readByOID(                ExecutionCourse.class, executionCourseID);        if (executionCourse == null)            throw new InvalidArgumentsServiceException();        final IShift shift = SummaryUtils.getShift(persistentSupport, null, infoSummary);        final IRoom room = SummaryUtils.getRoom(persistentSupport, null, shift, infoSummary);        final IProfessorship professorship = SummaryUtils.getProfessorship(persistentSupport,                infoSummary);        if (professorship != null) {            final ISummary summary = executionCourse.createSummary(infoSummary.getTitle(), infoSummary                    .getSummaryText(), infoSummary.getStudentsNumber(), infoSummary.getIsExtraLesson(),                    professorship);            shift.transferSummary(summary, infoSummary.getSummaryDate().getTime(), infoSummary                    .getSummaryHour().getTime(), room);            return true;        }        final ITeacher teacher = SummaryUtils.getTeacher(persistentSupport, infoSummary);        if (teacher != null) {            if (!teacherBelongsToExecutionCourse(teacher, executionCourse)) {                final ISummary summary = executionCourse.createSummary(infoSummary.getTitle(),                        infoSummary.getSummaryText(), infoSummary.getStudentsNumber(), infoSummary                                .getIsExtraLesson(), teacher);                shift.transferSummary(summary, infoSummary.getSummaryDate().getTime(), infoSummary                        .getSummaryHour().getTime(), room);                return true;            }            else{                throw new FenixServiceException("error.summary.teacher.invalid");            }        }        String teacherName = infoSummary.getTeacherName();        if (teacherName != null) {            final ISummary summary = executionCourse.createSummary(infoSummary.getTitle(), infoSummary                    .getSummaryText(), infoSummary.getStudentsNumber(), infoSummary.getIsExtraLesson(),                    teacherName);            shift.transferSummary(summary, infoSummary.getSummaryDate().getTime(), infoSummary                    .getSummaryHour().getTime(), room);            return true;        }        throw new FenixServiceException("error.summary.no.teacher");    }