Versions Compared

Key

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

Document Logs
Change log:

Date:

Author:

Doc Version:

Changes:

Ext.

Int.

Is in Core

26 May 2011

DWN

0.1

Doc. created

 

 

 

15 March 2012

CM

0.2

New parameter Tree

 

 

 

28 August 2012

CM

0.3

Added new parameter values

 

 

 

01 March 2013

JSK

0.4

Added extra column descriptions for CDR_FILE_DEF and CDR_RECORD_DEF.

 

 

 

07 October 2013

JSK

1.12

Added section 3.1.11 concerning Hookpoint Invokation in the Pre or Post process of file processing.

 

 

 

14 May 2014

KTH

1.12.1

Added new parameter: DB_SYS_PACKAGE_NAME

 

 

 

22 May 2014KTH1.12.2Added new Parameter: CHARACTER_ENCODING   
30 October 2015KTH1.13

Added new column SEQUENCE columns to CDR_RECORDFILE_DEF table

(Available for FileProcessor Integration project version 2.2)

   
26 NovemberKaruna Thulluri1.14

JSON File export feature added

Added new column XML_FILE_NAME_COLUMN columns to CDR_FILE_DEF table

(Available for FileProcessor Integration project version 2.23-SNAPSHOT. Yet to be released)

   

...

1 - Purpose of Document

...

Figure 2.1 (below) represents the above tables and their respective classes:

Drawio
diagramNameCdrFileDataModelFinalNew.drawio
revision1

Figure 2.1 Data Model for CDR file

...

The above design is shown in figure 2.3.1 below:

Image RemovedImage Added
Figure 2.3.1 File Processor UML.

3

...

Model Description

3.1 Loading Files

To configure the loading of a file, the following must be defined or configured.

...

COLUMN NAME

DESCRIPTION

NAME

Name of the Cdr File Definition

DESCRIPTION

Description of Cdr File Definition

KEY

Unique key of a file defintion

CODE

Code, in-case sub classing is needed in the future

MAX_RECORDS

Maximum number of records in a file (Default value -1 (no maximum number of records))

CDR_PARSER_ID

Parser used for parsing a file into records (CDR_PARSER_ID = CDR_PARSER.ID)

BILLING_SOURCE_TABLE_NAME

Table name for storing file information source

RECORD_SEPARATOR_ID

Type of separator used for separating one record from another (RECORD_SEPARATOR_ID = ITEM_SEPARATOR.ID). The default is a carriage return line feed

FILENAME_FORMAT

Format of filename to be loaded (Perl regular expression format). If set only filenames that match the format will be processed otherwise all files are processed

EXPORT_TYPE

The type of file records to be exported. Used when generating export files. The source table (for export) must have a column with name 'EXPORT_TYPE' whose value must match this value

PRE_EXPORT_PROCEDURE

Used when exporting files. Called before any final generation processing commences. Used to add extra export values that can only be added at time of export

XML_DOCUMENT_DEF_ID

Used when exporting XML files. (XML_DOCUMENT_DEF_ID = XML_DOCUMENT_DEF.ID)

BILLING_SOURCE_CLASS

Class used to model the table defined in the column 'BILLING_SOURCE_TABLE_NAME'

FILE_NAME_SUFFIX

Suffix (extension) to be added to the export filename

FILE_NAME_GENERATOR_METHOD

Method on the BILLING_SOURCE_CLASS used to generate a filename during export. This method must take the ID of the record in the 'BILLING_SOURCE_TABLE_NAME' table, and the CDR_FILE_DEF ID as parameters. For example for exporting a CDR file, the ID will be the ID of the appropriate SP_FILE_HEADER record linked to the rated BILLING_RECORDs (BILLING_RECORD.SP_FILE_ID = SP_FILE_HEADER.ID) being exported.

PRE_PROCESSOR_METHOD

Method in the BILLING_SOURCE_CLASS called before processing a file. The method must take CdrFileDef object as parameter. Could be used to validate if a file has already been loaded or to delete all records in a table before loading.

POST_PROCESSOR_METHOD

Method in the BILLING_SOURCE_CLASS called after processing a file. The method must take CdrFileDef object as parameter. Could be used for validating contents of the detail against information on the trailer.

RECORD_FOR_HEADER

Possible values are Y and N. This column is solely taken into an account, if the PERSIST column has the value Y. In case the first line in the loaded file must be stored in the BATCH_FILE_LINE table, the RECORD_FOR_HEADER column must be set to Y.

STATUS_COLUMN_NAME

String value. Defines the column name for status of billing source table. If left empty a default name of STATUS is used.

NUMBER_OF_RECS_COLUMN_NAME

String with default value 'NUMBER_OF_RECS'. Defines the column name, where the number of the content lines in a loaded file must be stored.

DATE_LOADED_COLUMN_NAME

String with default value 'DATE_LOADED'. Defines the column name, where the time of the loading must be stored. The column is mandatory in the billing source table.

SAVE_RECORD_ORDER

Char with possible values 'Y'/'N' and default value 'N'. Defines whether line number of a loaded record must be stored in the db.

RECORD_ORDER_COLUMN_NAME

String with default value 'LINE_IN_FILE'. Defines the column name, where the line number of the loaded record must be stored.

STATUS_VALUE

String with default value '0'. Defines the status of the loaded file.

COMMENT_COLUMN_NAME

Defines the column name in the billing source table (defined in the column billing_source_table_name), where error messages are posted, if a file generation fails. Not mandatory in the billing source table. If left out, error messages are simply not posted in the billing source table.

PRE_PROCESSOR_HOOKPOINT_KEY

Sets the Hookpoint key to be called in the pre-process. Is invoked with the prefix FILE_PROCESSOR_.

POST_PROCESSOR_HOOKPOINT_KEY

Sets the Hookpoint key to be called in the post-process. Is invoked with the prefix FILE_PROCESSOR_.

COLUMN NAME

DESCRIPTION

XML_FILE_NAME_COLUMNThis column can be used to generate both a flat file and also an Xml file for the same source record. The value of XML_FILE_NAME_COLUMN must _NAME

The value of FILE_NAME_COLUMN should be the name of the column from the Source table where the generated XML filename will be saved to. The FILENAME column of Source table will be used to save the filename, if this If CDR_FILE_DEF.XML_FILE_NAME_COLUMN_NAMEis empty, the FILENAME column of Source table will be used to save the filename.

If both a flat file and , an XML file and a JSON file should be generated on the same source record:

  • FILENAME column of Source table will be used to save the filename of the flat file
  • The source table column name configured in XML_

    Then define 3 different CDR_FILE_DEF entries, each with proper column name set in the FILE_NAME_COLUMN

    of

    _NAME. For example:

    • First CDR_FILE_DEF entry for flat file generation: CDR_FILE_DEF record .FILE_NAME_COLUMN_NAMEis empty. So the generated flat file name will be used to save the XML file name.

    3.1.2 CDR Record Definition (CDR_RECORD_DEF)

    A CDR Record Definition (CDR_RECORD_DEF) defines a record in a CDR file and has the following columns in the CDR_RECORD_DEF table.

    • saved to FILENAME column of Source table
    • Second CDR_FILE_DEF entry for XML file generation: CDR_FILE_DEF.FILE_NAME_COLUMN_NAME= XML_FILE_NAME. So the generated XML file name will be saved to XML_FILE_NAME column of Source table
    • Third CDR_FILE_DEF entry for JSON file generation: CDR_FILE_DEF.FILE_NAME_COLUMN_NAME= JSON_FILE_NAME. So the generated JSON file name will be saved to JSON_FILE_NAME column of Source table

    3.1.2 CDR Record Definition (CDR_RECORD_DEF)

    A CDR Record Definition (CDR_RECORD_DEF) defines a record in a CDR file and has the following columns in the CDR_RECORD_DEF table.

    COLUMN NAME

    DESCRIPTION

    ID

    Unique table ID

    NAME

    Name of record definition

    CODE

    Code for sub-classing should one of the following DETAIL, HEADER, TRAILER

    DESCRIPTION

    Record definition description

    CDR_FILE_DEF_ID

    ID of CDR_FILE_DEF to which this record definition record belongs

    FIELD_SEPARATOR_ID

    Defines what separates one record field from another. Points to a record in the ITEM_SEPARATOR table (CDR_RECORD_DEF.FIELD_SEPARATOR_ID = ITEM_SEPRARATOR.ID)

    MAX_LENGTH

    Defines the length of the record; the default value being -1 meaning record is of variable length

    FULL_LENGTH

    If the MAX_LENGTH attribute is not -1, and the FULL_LENGTH attribute is set to ‘Y’, then the record must be of length MAX_LENGTH. Default value is N

    CDR_PARSER_ID

    Parser used to parse a record into fields. (CDR_RECORD_DEF.CDR_PARSER_ID = CDR_PARSER.ID

    RECORD_TABLE_NAME

    Name of the table where records are saved. Usually for header and trailer records, the value of this table is the SOURCE_TABLE while for detail records it is the record (BILLING_RECORD) table

    RECORD_TABLE_CODE

    Code to be used in the record table in-case sub-classing is to be used

    RECORD_IDENTIFIER_TYPE

    If this value is set, then the record will be identified using a CDR_RECORD_IDENTIFIER. Possible values are 'ALL' or 'AT_LEAST_ONE'. These are explained in subsection 3.1.3.

    PERSIST

    Determines if a record should be persisted. Sometimes, one may not need to persist a CDR_RECORD (as in the case where the record is a header of column name). Default value is 'Y' (meaning persist data) otherwise it is 'N' (meaning do not persist data).

    RECORD_CLASS

    The fully qualified class name of that models the table defined by the RECORD_TABLE_NAME

    SOURCE_TABLE_KEY

    This columns holds the column name in RECORD_TABLE_NAME table that points to the SOURCE TABLE. This is used by CDR_RECORD_DEFs.
    For file generator:
    For CDR_RECORD_DEF entries having CODE = 'DETAIL': If this field is empty, the value 'SP_FILE_ID' is used.
    For CDR_RECORD_DEF entries having CODE = 'HEADER' or 'TRAILER': If this field is empty, the value 'ID' is used. This is usually the case when the HEADER table is also the source table. So if the file should contain HEADER, TRAILER and DETAIL records and the data model in the DB contains an extra table for holding the SOURCE info, then all three CDR_RECORD_DEF entries (For HEADER, TRAILER and DETAIL) must contain appropriate value in SOURCE_TABLE_KEY. 
    For file loader:
    This is used only by CDR_RECORD_DEFs with CODE = 'DETAIL'. If this field is empty, the value 'BILLING_SOURCE_ID' is used.
    For example if the 'BILLING_SOURCE_TABLE_NAME' - of the appropriate CDR_FILE_DEF record - is IBASIS_MONTH and the detail record table name (RECORD_TABLE_NAME) is IBASIS_RECORD where IBASIS_RECORD.IBASIS_MONTH_ID = IBASIS_MONTH.ID, then the SOURCE_TABLE_KEY will have a value of ‘IBASIS_MONTH_ID’.

    STATUS_COLUMN_NAME

    String value. Name of the column where the record status must be stored.

    STATUS_VALUE

    Value to be set in status column defined in STATUS_COLUMN_NAME.

    HOOKPOINT_KEY

    If this is set, it will save this value into RECORD_TABLE_NAME.HOOKPOINT_KEY, not a mandatory value.

    SEQUENCE

    SEQUENCE column is used to define multiple record definitions for same record type (i.e. for example multiple record definitions for HEADER record for same File Definition) and define the sequence in which they can appear in the exported file. For example, if an exported file should contain 3 lines in the header and each of these lines has a difference structure, then it is possible to define 3 HEADER record definition entries with SEQUENCE 1, 2 and 3 based on the required order of these lines in the file. Then the file processor with get all the header definitions and handles one by one in the defined sequence, writing the lines matching that record definition only. 

    Important Note: If only one record definition entry is needed for a record type, then the SEQUENCE Column of that record definition entry must be left empty.

     

    Example:

    NameCODESEQUENCEDESCRIPTIONCDR_FILE_DEF_ID RECORD_TABLE_NAME
    DemoFile_Header1HEADER1Header record definition 1123456789DEMO_FILE_HEADER
    DemoFile_Header2HEADER2Header record definition 2 123456789DEMO_FILE_HEADER
    DemoFile_RecordDETAIL Detail record definition 123456789DEMO_FILE_RECORD
    DemoFile_FooterTRAILER Trailer record definition 123456789DEMO_FILE_FOOTER

    ...

    • Parameter 1 is the engine name (“CDR_FILE_LOADER_ENGINE” (for CdrFileLoaderEngine) or “CDR_EXPOR_FILE_GENERATOR_ENGINE” (for CdrExportFileGeneratoeEngine)), or “CDR_FILE_PROCESSING_ENGINE” (for both loading and file generation)).
    • Parameter 2 is the Engine Instance Number
    • Parameter 3 is the type of processing (“LOADER” (for CdrFileLoaderEngine) or “GENERATOR” (for CdrExportFileGeneratoeEngine)).
      If parameter 3 is not set, then the engine will perform both loading and export file generation.

    4

    ...

    Parameter Setup

    The following table shows the parameter setup that can be used by CdrFileprocessorEngine. The parameters are under the node "FILE_PROCESSING".

    NAME

    VALUE

    TYPE

    OPTIONAL

    DESCRIPTION

    MOVE_INVALID_FILE

    true|false

    String

    Yes

    Defines whether the engine should move files if they do not meet the pattern name criteria

    MAX_FILES_TO_LOAD

    integer bigger than 0

    Integer

    Yes

    Defines the number of files that are processed in a single engine iteration. If not present, the default value is 50

    BATCH_SIZE

    integer bigger than 0

    Integer

    Yes

    Number of SQL statements size used to load in batch. If not present, the default value is 100

    DB_SYS_PACKAGE_NAME

    SYS/CORE_SYS

    String

    YesDefines

    the name of (Mandatory if CORE_SYS package is used)

    Defines the name of the sys package to be used in SQL-statements

    Default SYS (if this parameter is not defined)

    CHARACTER_ENCODING<Valid character encoding>StringYesDefines the character encoding to be used while importing the files. If this parameter exists, the encoding specified in this parameter will be used to read the file. Otherwise the default encoding will be used.

     

    5  MONITORING

    5.1 File Generator

    If the File Processor engine cannot generate the file due to an exception, it will insert an entry into EXCEPTION_LOG table. The ID from EXCEPTION_LOG.EXCEPTION_STACK_TRACE_ID can be used to find the corresponding entry from EXCEPTION_STACK_TRACE, which contains the stack trace of the exception. 

    Code Block
    languagesql
    select * from EXCEPTION_LOG where TABLE_NAME = 'CDR_FILE_PROCESSOR' and SOURCE_KEY = '<CDR_FILE_PROCESSOR.NAME for corresponding CDR_FILE_PROCESSOR entry>' order by id desc; 

    5.1 File Loader

    If the File Processor engine cannot load  the file due to an exception or due to errors while parsing the file, it will insert an entry into LOAD_ERRORS table. 

    File Processor engine inserts an entry into CDR_FILE_PROCESSOR_LOG table upon successful loading of the file.