IEnrolment enrolment = enrolmentDAO.readByStudentCurricularPlanAndCurricularCourseAndExecutionPeriod(
IEnrollment enrolment = enrolmentDAO.readByStudentCurricularPlanAndCurricularCourseAndExecutionPeriod(
	public void run(Integer executionDegreeId, Integer studentCurricularPlanID, Integer optionalCurricularCourseID,		Integer chosenCurricularCourseID, String year, TipoCurso degreeType) throws FenixServiceException	{		try		{			ISuportePersistente persistentSuport = SuportePersistenteOJB.getInstance();			IPersistentEnrolment enrolmentDAO = persistentSuport.getIPersistentEnrolment();			IStudentCurricularPlanPersistente studentCurricularPlanDAO = persistentSuport.getIStudentCurricularPlanPersistente();			IPersistentCurricularCourse curricularCourseDAO = persistentSuport.getIPersistentCurricularCourse();			IStudentCurricularPlan studentCurricularPlan = (IStudentCurricularPlan) studentCurricularPlanDAO.readByOID(				StudentCurricularPlan.class, studentCurricularPlanID);			ICurricularCourse optionalCurricularCourse = (ICurricularCourse) curricularCourseDAO.readByOID(CurricularCourse.class,				optionalCurricularCourseID);						ICurricularCourse chosenCurricularCourse = (ICurricularCourse) curricularCourseDAO.readByOID(CurricularCourse.class,				chosenCurricularCourseID);						IPersistentExecutionYear executionYearDAO = persistentSuport.getIPersistentExecutionYear();			IExecutionYear executionYear = executionYearDAO.readExecutionYearByName(year);						IExecutionPeriod executionPeriod = WriteEnrollmentsList.findExecutionPeriod(persistentSuport, executionYear,				chosenCurricularCourseID, degreeType);			IEnrolment enrolment = enrolmentDAO.readByStudentCurricularPlanAndCurricularCourseAndExecutionPeriod(				studentCurricularPlan, optionalCurricularCourse, executionPeriod);			if (enrolment == null)			{				IEnrolmentInOptionalCurricularCourse enrolmentToWrite = new EnrolmentInOptionalCurricularCourse();				enrolmentDAO.simpleLockWrite(enrolmentToWrite);				enrolmentToWrite.setCurricularCourse(optionalCurricularCourse);				enrolmentToWrite.setCurricularCourseForOption(chosenCurricularCourse);				enrolmentToWrite.setEnrolmentState(EnrolmentState.ENROLED);				enrolmentToWrite.setExecutionPeriod(executionPeriod);				enrolmentToWrite.setStudentCurricularPlan(studentCurricularPlan);				enrolmentToWrite.setEnrolmentEvaluationType(EnrolmentEvaluationType.NORMAL_OBJ);				createEnrollmentEvaluation(enrolmentToWrite);				WriteEnrolment.createAttend(studentCurricularPlan.getStudent(), chosenCurricularCourse, executionPeriod,					enrolmentToWrite);			}		} catch (ExcepcaoPersistencia e)		{			e.printStackTrace();			throw new FenixServiceException(e);		}		WriteEnrolment.resetAttends();	}