package br.com.centralit.citcorpore.negocio;

import java.util.ArrayList;
import java.util.List;

import br.com.centralit.bpm.dto.ElementoFluxoDTO;
import br.com.centralit.bpm.integracao.ElementoFluxoDao;
import br.com.citframework.service.CrudServiceImpl;

@SuppressWarnings("unchecked")
public class ElementoFluxoServiceEjb extends CrudServiceImpl implements ElementoFluxoService {

	private ElementoFluxoDao elementoFluxoDao;

	@Override
	protected ElementoFluxoDao getDao() {
		if (elementoFluxoDao == null) {
			elementoFluxoDao = new ElementoFluxoDao();
		}
		return elementoFluxoDao;
	}

	@Override
	public List<ElementoFluxoDTO> listaElementoFluxo(String consulta) throws Exception {
		List<ElementoFluxoDTO> lista = getDao().listaElementoFluxo(consulta);

		if (lista == null)
			lista = new ArrayList<ElementoFluxoDTO>();

		return lista;
	}

}
