IEnrolment enrolment =
IEnrollment enrolment =
	public void run(		Integer executionDegreeId, 		Integer studentCurricularPlanID,		Integer curricularCourseID,		Integer executionPeriodID)		throws FenixServiceException	{		try		{			ISuportePersistente persistentSuport = SuportePersistenteOJB.getInstance();			IPersistentEnrolment enrolmentDAO = persistentSuport.getIPersistentEnrolment();			IStudentCurricularPlanPersistente studentCurricularPlanDAO =				persistentSuport.getIStudentCurricularPlanPersistente();			IPersistentExecutionPeriod executionPeriodDAO =				persistentSuport.getIPersistentExecutionPeriod();			IPersistentCurricularCourse curricularCourseDAO =				persistentSuport.getIPersistentCurricularCourse();			IStudentCurricularPlan studentCurricularPlan =				(IStudentCurricularPlan) studentCurricularPlanDAO.readByOID(					StudentCurricularPlan.class,					studentCurricularPlanID);			ICurricularCourse curricularCourse =				(ICurricularCourse) curricularCourseDAO.readByOID(					CurricularCourse.class,					curricularCourseID);			IExecutionPeriod executionPeriod = null;			if (executionPeriodID == null)			{				executionPeriod = executionPeriodDAO.readActualExecutionPeriod();			}			else			{				executionPeriod =					(IExecutionPeriod) executionPeriodDAO.readByOID(						ExecutionPeriod.class,						executionPeriodID);			}			IEnrolment enrolment =				enrolmentDAO.readByStudentCurricularPlanAndCurricularCourseAndExecutionPeriod(					studentCurricularPlan,					curricularCourse,					executionPeriod);			if (enrolment == null)			{				IEnrolment enrolmentToWrite = new Enrolment();				enrolmentDAO.simpleLockWrite(enrolmentToWrite);				enrolmentToWrite.setCurricularCourse(curricularCourse);				enrolmentToWrite.setEnrolmentState(EnrolmentState.ENROLED);				enrolmentToWrite.setExecutionPeriod(executionPeriod);				enrolmentToWrite.setStudentCurricularPlan(studentCurricularPlan);				enrolmentToWrite.setEnrolmentEvaluationType(EnrolmentEvaluationType.NORMAL_OBJ);				enrolmentToWrite.setCreationDate(new Date());				createEnrollmentEvaluation(enrolmentToWrite);				createAttend(					studentCurricularPlan.getStudent(),					curricularCourse,					executionPeriod,					enrolmentToWrite);			}		}		catch (ExcepcaoPersistencia e)		{			e.printStackTrace();			throw new FenixServiceException(e);		}		resetAttends();	}