IEnrolment enrolment = (IEnrolment) iterEnrolment.next();
IEnrollment enrolment = (IEnrollment) iterEnrolment.next();
	public InfoSiteEnrolmentEvaluation run(Integer curricularCourseCode, String yearString)		throws FenixServiceException	{		List infoEnrolmentEvaluations = new ArrayList();		InfoTeacher infoTeacher = new InfoTeacher();		InfoExecutionPeriod infoExecutionPeriod = new InfoExecutionPeriod();		try		{			ISuportePersistente sp = SuportePersistenteOJB.getInstance();			IPersistentEnrolmentEvaluation persistentEnrolmentEvaluation =				sp.getIPersistentEnrolmentEvaluation();			IPersistentCurricularCourse persistentCurricularCourse = sp.getIPersistentCurricularCourse();			IPersistentEnrolment persistentEnrolment = sp.getIPersistentEnrolment();			IPersistentTeacher persistentTeacher = sp.getIPersistentTeacher();			IPersistentExecutionPeriod persistentExecutionPeriod = sp.getIPersistentExecutionPeriod();						ICurricularCourse curricularCourse = new CurricularCourse();			curricularCourse.setIdInternal(curricularCourseCode);			curricularCourse =				(ICurricularCourse) persistentCurricularCourse.readByOId(curricularCourse, false);			List enrolments = null;			if (yearString != null)			{				enrolments =					persistentEnrolment.readByCurricularCourseAndYear(curricularCourse, yearString);			}			else			{				enrolments = persistentEnrolment.readByCurricularCourse(curricularCourse);			}			List enrolmentEvaluations = new ArrayList();			Iterator iterEnrolment = enrolments.listIterator();			while (iterEnrolment.hasNext())			{				IEnrolment enrolment = (IEnrolment) iterEnrolment.next();				List allEnrolmentEvaluations =					persistentEnrolmentEvaluation.readEnrolmentEvaluationByEnrolment(enrolment);				IEnrolmentEvaluation enrolmentEvaluation =					(IEnrolmentEvaluation) allEnrolmentEvaluations.get(						allEnrolmentEvaluations.size() - 1);				enrolmentEvaluations.add(enrolmentEvaluation);			}			if (enrolmentEvaluations != null && enrolmentEvaluations.size() > 0)			{				List temporaryEnrolmentEvaluations = null;//				try//				{					temporaryEnrolmentEvaluations = checkForInvalidSituations(enrolmentEvaluations);////				}//				catch (ExistingServiceException e)//				{//					throw new ExistingServiceException();//				}//				catch (InvalidSituationServiceException e)//				{//					throw new InvalidSituationServiceException();//				}				//				get teacher responsible for final evaluation - he is responsible for all evaluations				// for this				//				curricularCourseScope				IPessoa person =					((IEnrolmentEvaluation) temporaryEnrolmentEvaluations.get(0))						.getPersonResponsibleForGrade();				ITeacher teacher = persistentTeacher.readTeacherByUsername(person.getUsername());				infoTeacher = Cloner.copyITeacher2InfoTeacher(teacher);				//				transform evaluations in databeans				ListIterator iter = temporaryEnrolmentEvaluations.listIterator();				while (iter.hasNext())				{					IEnrolmentEvaluation elem = (IEnrolmentEvaluation) iter.next();					InfoEnrolmentEvaluation infoEnrolmentEvaluation =						Cloner.copyIEnrolmentEvaluation2InfoEnrolmentEvaluation(elem);					infoEnrolmentEvaluation.setInfoEnrolment(						Cloner.copyIEnrolment2InfoEnrolment(elem.getEnrolment()));					infoEnrolmentEvaluations.add(infoEnrolmentEvaluation);				}			}			if (infoEnrolmentEvaluations.size() == 0)			{				throw new NonExistingServiceException();			}			IExecutionPeriod executionPeriod = persistentExecutionPeriod.readActualExecutionPeriod();			infoExecutionPeriod = (InfoExecutionPeriod) Cloner.get(executionPeriod);					}		catch (ExcepcaoPersistencia ex)		{			FenixServiceException newEx = new FenixServiceException("Persistence layer error");			newEx.fillInStackTrace();			throw newEx;		}		InfoSiteEnrolmentEvaluation infoSiteEnrolmentEvaluation = new InfoSiteEnrolmentEvaluation();		infoSiteEnrolmentEvaluation.setEnrolmentEvaluations(infoEnrolmentEvaluations);		infoSiteEnrolmentEvaluation.setInfoTeacher(infoTeacher);		Date evaluationDate =			((InfoEnrolmentEvaluation) infoEnrolmentEvaluations.get(0)).getGradeAvailableDate();		infoSiteEnrolmentEvaluation.setLastEvaluationDate(evaluationDate);		infoSiteEnrolmentEvaluation.setInfoExecutionPeriod(infoExecutionPeriod);				return infoSiteEnrolmentEvaluation;	}