CSV2XMLTransformation

From GreenVulcano Wiki
Revision as of 14:41, 2 April 2012 by Anonymous (talk) (How To)
Jump to: navigation, search

Description

CSV2XMLTransformation element defines a CSV to XML transformation.

GreenVulcano® ESB Configuration

CSV2XMLTransformation with VulCon

CSV2XMLTransformation is used by element Transformations.

The following table shows its attributes:

Attribute Type Description
type fixed This attribute must assume the value transformation.
class fixed This attribute must assume the value it.greenvulcano.gvesb.gvdte.transformers.bin.bin2xml.CSVToXMLTransformer
name required Transformation name.

The attribute's value cannot be null.

FieldDelimiter required CSV field delimiter. Default ','.

The attribute's value cannot be null.

UseCDATA required Defines if the fields values must be enclosed in a CDATA section.

The attribute's admitted values are:

  • True
  • False

CSV2XMLTransformation might contain the following sub-elements:


How To

To add a new CSV2XMLTransformation go to the VulCon® Core view. Expand the GVDataTransformation element and right clicking Transformation -> Insert after or Insert before -> CSV2XMLTransformation.

The following example shows the use of CSV2XMLTransformation to transform CDR data, passed in input as CSV files, into an XML.

    <CSV2XMLTransformation FieldDelimiter="," UseCDATA="False"
                           class="it.greenvulcano.gvesb.gvdte.transformers.bin.bin2xml.CSVToXMLTransformer"
                           name="ERICSSON_cdrToXml" type="transformation"/>
    <dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation"
                             name="ChangeCDRToXML" type="call">
                        <DBOBuilder class="it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder"
                                    jdbc-connection-name="ds.gv_cama" make-dump="text"
                                    name="ChangeCDRToXML" output-data="InsertOrUpdate"
                                    type="dbobuilder">
                            <DHVariables>
                                <DHVariable name="decimal-separator" value="."/>
                                <DHVariable name="grouping-separator" value=","/>
                                <DHVariable name="format" value="#0.00"/>
                            </DHVariables>
                            <DBOInsertOrUpdate class="it.greenvulcano.gvesb.datahandling.dbo.DBOInsertOrUpdate"
                                               input-data="csv_param"
                                               name="InsertAndUpdate"
                                               output-data="xml_param"
                                               transformation="ERICSSON_cdrToXml"
                                               type="dbo">
                                <statement id="0" type="insert">insert into CAMA.CDR_EVENT
(MSG_ID, MSISDN, EVENT, EVENT_TIME, NOTE, INS_DATE)
values((select ID from MESSAGES where MMS_ID = ?),?,?,?,&apos;&apos;,sysdate)</statement>
                                <statement id="1" type="update">UPDATE cama.cdr_event
SET EVENT = ?, EVENT_TIME = ?
WHERE MSG_ID = (select ID from CAMA.MESSAGES where MSG_ID = ?) and MSISDN = ?</statement>
                            </DBOInsertOrUpdate>
                        </DBOBuilder>
                    </dh-call>