throw new GuiderAlreadyChosenServiceException("error.exception.masterDegree.GuiderAlreadyChosen");
throw new GuiderAlreadyChosenServiceException("error.exception.masterDegree.guiderAlreadyChosen");
	public void run(		IUserView userView,		InfoStudentCurricularPlan infoStudentCurricularPlan,		String dissertationTitle,		ArrayList infoTeacherGuiders,		ArrayList infoTeacherAssistentGuiders,		ArrayList infoExternalPersonExternalAssistentGuiders)		throws FenixServiceException {		try {			if (infoTeacherGuiders.size() < 1)				throw new RequiredGuidersServiceException("error.exception.masterDegree.noGuidersSelected");			for (Iterator iter = infoTeacherGuiders.iterator(); iter.hasNext();) {				InfoTeacher guider = (InfoTeacher) iter.next();								for (Iterator iterator = infoTeacherAssistentGuiders.iterator(); iterator.hasNext();) {					InfoTeacher assistentGuider = (InfoTeacher) iterator.next();					if (assistentGuider.getIdInternal().equals(guider.getIdInternal())) {						throw new GuiderAlreadyChosenServiceException("error.exception.masterDegree.GuiderAlreadyChosen");					}				}			}			ISuportePersistente sp = SuportePersistenteOJB.getInstance();			IStudentCurricularPlan studentCurricularPlan = Cloner.copyInfoStudentCurricularPlan2IStudentCurricularPlan(infoStudentCurricularPlan);			IMasterDegreeThesis storedMasterDegreeThesis = sp.getIPersistentMasterDegreeThesis().readByStudentCurricularPlan(studentCurricularPlan);			if (storedMasterDegreeThesis != null)				throw new ExistingServiceException("error.exception.masterDegree.existingMasterDegreeThesis");			IMasterDegreeThesisDataVersion storedMasterDegreeThesisDataVersion =				sp.getIPersistentMasterDegreeThesisDataVersion().readActiveByDissertationTitle(dissertationTitle);			if (storedMasterDegreeThesisDataVersion != null)				if (!storedMasterDegreeThesisDataVersion.getMasterDegreeThesis().getStudentCurricularPlan().equals(studentCurricularPlan))					throw new ExistingServiceException("error.exception.masterDegree.dissertationTitleAlreadyChosen");			IPessoa person = sp.getIPessoaPersistente().lerPessoaPorUsername(userView.getUtilizador());			IEmployee employee = sp.getIPersistentEmployee().readByPerson(person.getIdInternal().intValue());			IMasterDegreeThesis masterDegreeThesis = new MasterDegreeThesis(studentCurricularPlan);			sp.getIPersistentMasterDegreeThesis().simpleLockWrite(masterDegreeThesis);			//write data version			IMasterDegreeThesisDataVersion masterDegreeThesisDataVersion =				new MasterDegreeThesisDataVersion(					masterDegreeThesis,					employee,					dissertationTitle,					new Timestamp(new Date().getTime()),					new State(State.ACTIVE));			List guiders = Cloner.copyListInfoTeacher2ListITeacher(infoTeacherGuiders);			List assistentGuiders = Cloner.copyListInfoTeacher2ListITeacher(infoTeacherAssistentGuiders);			List externalAssistentGuiders = Cloner.copyListInfoExternalPerson2ListIExternalPerson(infoExternalPersonExternalAssistentGuiders);			masterDegreeThesisDataVersion.setGuiders(guiders);			masterDegreeThesisDataVersion.setAssistentGuiders(assistentGuiders);			masterDegreeThesisDataVersion.setExternalAssistentGuiders(externalAssistentGuiders);			sp.getIPersistentMasterDegreeThesisDataVersion().simpleLockWrite(masterDegreeThesisDataVersion);		} catch (ExcepcaoPersistencia ex) {			FenixServiceException newEx = new FenixServiceException("Persistence layer error");			newEx.fillInStackTrace();			throw newEx;		}	}