Fixed flat file writer for virtual Business Objects

The fixed flat file reader for virtual Business Objects:

  • Reads AccountingIntegrator flat files.
  • Transforms them into Interplay Objects and Elements.
  • Saves these objects in the database.

The Java class called Level2FixedFlatFileReader must be declared in the interplayPublicContext.xml file as follows:

<bean id="accIntReaderVirtualBO" scope="prototype"

class="com.axway.interplay.core.externaldata.importdata.readers.Level2FixedFlatFileReader">

<property name="dataSource" ref="jdbcDataSource" />

<property name="readerType" value="FixedFlatFile" />

</bean>

The reader uses a File that contains:

  • AccoutingIntegrator Input-Events.
  • Rejected AccoutingIntegrator Input-Events created via the rdjews command from AccountingIntegrator.
    A 300-character error section exists at the beginning of each line and includes:
    • An error code: offset=1, length=7
    • An error label: offset=8, length=72 and offset=91; length=50
    • A label for the events that have no error "Valid Segment for a rejected IEvent" or "Enregistrement valide d'un CRE en erreur."

For the import to succeed, the import class requires information to be set on the Collection Type, that defines the structure of the file to import. The Has errors property determines if the file to import contains error information at the beginning of each line.

The difference between this reader and the standard Fixed flat file reader concerns the data structure. The Collection Type must reference a single Business ObjectType. This ObjectType must have one or several types of sub-Elements and all the properties from the Object Type level must be inherited by all the Element Types (except variable properties and computed properties).

Example of structure

An example for such a structure is :

  • ObjectType
    • PROPERTY_1
    • PROPERTY_2
  • ElementType1 (complex type)
    • PROPERTY_1e1 (inherits from PROPERTY_1)
    • PROPERTY_2e1 (inherits from PROPERTY_2)
    • PROPERTY_3e1
    • PROPERTY_4e1
  • ElementType2 (complex type)
    • PROPERTY_1e2 (inherits from PROPERTY_1)
    • PROPERTY_2e2 (inherits from PROPERTY_2)
    • PROPERTY_3e2
    • PROPERTY_4e2

All properties of the Object Type must be inherited by the element.

The file that is imported using this reader contains only sub-Element lines. Using the example structure , the reader will create a new object for each unique pair of PROPERTY_1e and PROPERTY_2e and all lines that will have the same values for these two properties will be converted into Elements and their parent will be the Object specified above.

Related Links