	public void importTag() throws ServiceException {
		try {
			this.session = this.getInfrastructure().getSession();
			TagDataImportRepositoryInterface imp_repo = this
					.getDomainsDirectory().getDataImportDomain()
					.getTagDataImportRepository();
			LedgerRepositoryInterface ledger_repo = this.getDomainsDirectory()
					.getLedgerDomain().getLedgerRepository();
			List<DataImportTag> dataforimp = imp_repo
					.findNotProcessesDataImportTags();
			int imported = 0;
			Transaction imp_tx1 = null;
			for (int i = 0; i < dataforimp.size(); i++) {
				DataImportTag rawdata = dataforimp.get(i);
				try {
					imp_tx1 = null;
					String id = ledger_repo.getNextSeqId("Enumeration");
					Enumeration enumeration = new Enumeration();
					if (rawdata.getSequenceNum() != null) {
						List<EnumerationType> types = ledger_repo.findList(
								EnumerationType.class, ledger_repo.map(
										EnumerationType.Fields.enumTypeId,
										rawdata.getType()));
						List<Enumeration> enums1 = ledger_repo.findList(
								Enumeration.class, ledger_repo.map(
										Enumeration.Fields.sequenceId, rawdata
												.getSequenceNum(),
										Enumeration.Fields.enumTypeId, types
												.get(0).getEnumTypeId()));
						if (enums1.isEmpty()) {
							Debug.log("Registro Nuevo");
							enumeration.setEnumId(id);
						} else {
							enumeration.setEnumId(enums1.get(0).getEnumId());
						}
						enumeration.setEnumTypeId(types.get(0).getEnumTypeId());
						enumeration.setSequenceId(rawdata.getSequenceNum());
						enumeration.setEnumCode(rawdata.getName());
						enumeration.setFechaInicio(rawdata.getFechaInicio());
						enumeration.setFechaFin(rawdata.getFechaFin());
						enumeration.setDescription(rawdata.getDescription());
						enumeration.setNivelId(rawdata.getNivel());
						enumeration.setNode(rawdata.getNode());
						imp_tx1 = this.session.beginTransaction();
						ledger_repo.createOrUpdate(enumeration);
						imp_tx1.commit();
					}
					String message = "Successfully imported Tag ["
							+ rawdata.getId() + "].";
					this.storeImportTagSuccess(rawdata, imp_repo);
					Debug.logInfo(message, MODULE);
					imported = imported + 1;
				} catch (Exception ex) {
					String message = "Failed to import Tag [" + rawdata.getId()
							+ "], Error message : " + ex.getMessage();
					storeImportTagError(rawdata, message, imp_repo);
					if (imp_tx1 != null) {
						imp_tx1.rollback();
					}
					Debug.logError(ex, message, MODULE);
					throw new ServiceException(ex.getMessage());
				}
			}
			getParentEnumeration(ledger_repo, dataforimp);
			this.importedRecords = imported;
		} catch (InfrastructureException ex) {
			Debug.logError(ex, MODULE);
			throw new ServiceException(ex.getMessage());
		} catch (RepositoryException ex) {
			Debug.logError(ex, MODULE);
			throw new ServiceException(ex.getMessage());
		} finally {
			if (session != null) {
				session.close();
			}
		}
	}

	public void importTag() throws ServiceException {
		try {
			this.session = this.getInfrastructure().getSession();
			TagDataImportRepositoryInterface imp_repo = this
					.getDomainsDirectory().getDataImportDomain()
					.getTagDataImportRepository();
			LedgerRepositoryInterface ledger_repo = this.getDomainsDirectory()
					.getLedgerDomain().getLedgerRepository();
			List<DataImportTag> dataforimp = imp_repo
					.findNotProcessesDataImportTags();
			int imported = 0;
			Transaction imp_tx1 = null;
			for (int i = 0; i < dataforimp.size(); i++) {
				DataImportTag rawdata = dataforimp.get(i);
				try {
					imp_tx1 = null;
					String id = ledger_repo.getNextSeqId("Enumeration");
					Enumeration enumeration = new Enumeration();
					if (rawdata.getSequenceNum() != null) {
						List<EnumerationType> types = ledger_repo.findList(
								EnumerationType.class, ledger_repo.map(
										EnumerationType.Fields.enumTypeId,
										rawdata.getType()));
						List<Enumeration> enums1 = ledger_repo.findList(
								Enumeration.class, ledger_repo.map(
										Enumeration.Fields.sequenceId, rawdata
												.getSequenceNum(),
										Enumeration.Fields.enumTypeId, types
												.get(0).getEnumTypeId()));
						if (enums1.isEmpty()) {
							Debug.log("Registro Nuevo");
							enumeration.setEnumId(id);
						} else {
							enumeration.setEnumId(enums1.get(0).getEnumId());
						}
						enumeration.setEnumTypeId(types.get(0).getEnumTypeId());
						enumeration.setSequenceId(rawdata.getSequenceNum());
						enumeration.setEnumCode(rawdata.getName());
						enumeration.setFechaInicio(rawdata.getFechaInicio());
						enumeration.setFechaFin(rawdata.getFechaFin());
						enumeration.setDescription(rawdata.getDescription());
						enumeration.setNivelId(rawdata.getNivel());
						enumeration.setNode(rawdata.getNode());
						imp_tx1 = this.session.beginTransaction();
						ledger_repo.createOrUpdate(enumeration);
						imp_tx1.commit();
					}
					String message = "Successfully imported Tag ["
							+ rawdata.getId() + "].";
					this.storeImportTagSuccess(rawdata, imp_repo);
					Debug.logInfo(message, MODULE);
					imported = imported + 1;
				} catch (Exception ex) {
					String message = "Failed to import Tag [" + rawdata.getId()
							+ "], Error message : " + ex.getMessage();
					storeImportTagError(rawdata, message, imp_repo);
					if (imp_tx1 != null) {
						imp_tx1.rollback();
					}
					Debug.logError(ex, message, MODULE);
					throw new ServiceException(ex.getMessage());
				}
			}
			getParentEnumeration(ledger_repo, dataforimp, imp_repo);
			this.importedRecords = imported;
		} catch (InfrastructureException ex) {
			Debug.logError(ex, MODULE);
			throw new ServiceException(ex.getMessage());
		} catch (RepositoryException ex) {
			Debug.logError(ex, MODULE);
			throw new ServiceException(ex.getMessage());
		} finally {
			if (session != null) {
				session.close();
			}
		}
	}
