Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Date:

Author:

Version:

Changes:

Ext.

Int.

Is in Core

Jira Ref.

XX Month 20XX

Kilroy

0.1

Doc. created

x

 

N/A

 

Description

The purpose of this document is to provide a description of the configuration of Xml Cdr files, so that they can be read correctly by the Service Providers.

1- Xml Generation

For HI3G we needed to export the CDR files and the records related to them in XML format. For this reason we have created some generic utilities in Rator to generate XML.

...

Once the configuration is ready the Xml Producer just needs the data, that will be passed as a Map.

Code Block
xml
xml

<File>
  <Name>M_OI_BIL.M_SP_CORR.GGSN101_20101125235414_14068.dat.SP_IN.038476.dat</Name>
  <BillingSourceId>201012031002438274</BillingSourceId>
  <Record>
    <BillingRecordId>201011262043130885</BillingRecordId>
    <RatingKey></RatingKey>
    <PriceElements>
      <PriceElement>
        <ChargeItemId>201005121347550887</ChargeItemId>
        <Description>SMS til 31240912</Description>
        <IdlId>201012011045262305</IdlId>
      </PriceElement>
    </PriceElements>
    <Code>HI3GNET</Code>
    <Duration>0</Duration>
  </Record>
</File>

...

In this class is contained the specific logic for the generation of the xml document.

Examples Concrete subclasses of xmlFiller can be found in the core, see XmlFillerBillingRecords and XmlFillerIdl.FileProcessor Integration project: see GenericXMLFiller, XmlFillerBillingRecords and XmlFillerIdl.

3.3.1 - GenericXMLFiller

The GenericXMLfiller class contains the logic for creating an XML file from a list of records obtained by executing the SQL script configured via Parameter tree entries. This class can be used for generating the XML files from data obtained by joining some database tables by a query, configured in parameter tree as described below. If the required XML file needs to execute multiple SQL queries to get the data that is to be placed in the XML document in different levels, the GenericXMLfiller cannot be used. A new subclass of  XmlFiller need to be created, if the GenericXMLFiller cannot produce the XML file in required format.  

Parameter Tree entries used to configure the SQL script(s) used by GenericXMLFiller class:

Parameter Path/
Type

Description

Value

Mandatory

Default 
Value used 
if not mandatory
Root Node: FILE_PROCESSING.XML
RECORD_RETRIEVE_SQL



 String

SQL query to load the records from the Database tables, which are to be exported into the XML file. This SQL string can contain the label <BILLING_SOURCE_ID> which will be replaced with appropriate value at run-time.

If the SQL query string contains the label <BILLING_SOURCE_ID>, it will be replaced with the ID of the current source record currently being processed to create the XML file.

Note: The billing source table name is configured in the column BILLING_SOURCE_TABLE_NAME of the table CDR_FILE_DEF. <BILLING_SOURCE_ID> will be replaced with the ID of the current row being processed from the table configured in the column CDR_FILE_DEF.BILLING_SOURCE_TABLE_NAME.

Example:

Select vr.* from VOUCHER_EXPORT_RECORD vr where vr.VOUCHER_EXPORT_SOURCE_ID = <BILLING_SOURCE_ID> order by vr.id

YES 

RECORD_RETRIEVE_SQL_WITH_ID_GREATERTHAN_CLAUSE

String

SQL query to load the next batch of records with ID greater than the last loaded maximum ID, which are to be exported into the XML file.

This SQL query can contain the tags <BILLING_SOURCE_ID> and <MAX_LOADED_ID> labels which will be replaced with appropriate values at run-time

 

Example:

Select vr.* from VOUCHER_EXPORT_RECORD vr where vr.VOUCHER_EXPORT_SOURCE_ID = <BILLING_SOURCE_ID> and vr.id > <MAX_LOADED_ID> order by vr.id

YES 

Important Note: It is mandatory to setup both parameter tree entries RECORD_RETRIEVE_SQL, RECORD_RETRIEVE_SQL_WITH_ID_GREATERTHAN_CLAUSE, because the File processor XML filler classes are configured to load only a maximum 10000 records in one select. For example: If there are 20000 records, then the XML Filler has to reload the records, with ( ID > the max id from previous select).

So

  • The query from RECORD_RETRIEVE_SQL parameter is used to load the first batch of records (10000) .
  • If there are more records to be added to the same XML file, The SQL from RECORD_RETRIEVE_SQL_WITH_ID_GREATERTHAN_CLAUSE parameter is used to load the next batches , with 10000 max rows selected in each subsequent batch

3.4 - ValueFormatter

The value formatter has been introduced in order to be able to configure the formatting of objects. Here we can specify a formatter class and a pattern that will be used to generate a string.

...