Search in sources :

Example 1 with Aprovacao

use of com.tomasio.projects.trainning.model.Aprovacao in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method createParecer.

@Override
@Transactional
public Long createParecer(ParecerDTO parecer) {
    ParecerDAO dao = factory.getParecerDAO();
    IndicacaoDAO indicacaoDAO = factory.getIndicacaoDAO();
    Parecer _parecer = null;
    if (parecer instanceof AprovacaoDTO) {
        _parecer = new Aprovacao((AprovacaoDTO) parecer);
    } else {
        _parecer = new Reprovacao((ReprovacaoDTO) parecer);
    }
    Long id = null;
    try {
        id = dao.create(_parecer);
        Indicacao indicacao = indicacaoDAO.find(_parecer.getIndicacao().getId());
        updateWorkflowActors(indicacao.getId());
    } catch (DAOException ex) {
        ex.printStackTrace();
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new CoreException("Erro em tempo de execução: " + ex.getMessage());
    }
    return id;
}
Also used : IndicacaoDAO(com.tomasio.projects.trainning.dao.IndicacaoDAO) DAOException(com.tomasio.projects.trainning.exception.DAOException) Parecer(com.tomasio.projects.trainning.model.Parecer) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ParecerDAO(com.tomasio.projects.trainning.dao.ParecerDAO) Indicacao(com.tomasio.projects.trainning.model.Indicacao) Aprovacao(com.tomasio.projects.trainning.model.Aprovacao) Reprovacao(com.tomasio.projects.trainning.model.Reprovacao) ReprovacaoDTO(com.tomasio.projects.trainning.dto.ReprovacaoDTO) AprovacaoDTO(com.tomasio.projects.trainning.dto.AprovacaoDTO) DAOException(com.tomasio.projects.trainning.exception.DAOException) ParseException(java.text.ParseException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)1 ParecerDAO (com.tomasio.projects.trainning.dao.ParecerDAO)1 AprovacaoDTO (com.tomasio.projects.trainning.dto.AprovacaoDTO)1 ReprovacaoDTO (com.tomasio.projects.trainning.dto.ReprovacaoDTO)1 DAOException (com.tomasio.projects.trainning.exception.DAOException)1 CoreException (com.tomasio.projects.trainning.exeption.CoreException)1 Aprovacao (com.tomasio.projects.trainning.model.Aprovacao)1 Indicacao (com.tomasio.projects.trainning.model.Indicacao)1 Parecer (com.tomasio.projects.trainning.model.Parecer)1 Reprovacao (com.tomasio.projects.trainning.model.Reprovacao)1 ParseException (java.text.ParseException)1 Transactional (org.springframework.transaction.annotation.Transactional)1