Introduction

The requirement is to read the file using file content conversion, the flat file header and footer contains key field and detail does not contain key field using sender file adapter as mentioned in below question
How to convert the flat file to XML without Record type identifiers /Key field value

I want to show how we can implement this in PI/PRO.


Design

Create the sender data type as below.

Create receiver data type like below.


Create two message types using above data types and create below two service interfaces.

Create message mapping for above sender message type to receiver message type.

HeaderNode mapping like below.

DetailNode mapping like below.


FooterNode mapping like below.

Create operation mapping for above message mapping.

Configuration

Create the below IFLOW in NWDS.

Use below File Content Conversion in sender file adapter.


Testing

I used below sender file to test.

Message Mapping test:

The receiver file placed in the target directory with below content.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Apu Das

    How your sender CC FCC is working. You have put filedNames f1,f2,f3,f3, but in the input file first record contains 2 data and footer contains 2 data. Will not it throw error.
     

    (0) 
    1. Praveen Gandepalli Post author

      Hi Apu,

      No you don’t get an error because missingLastFields default value is ignore.

      NameA.missingLastFields

      If the inbound structure has less fields than specified in the configuration then the XML outbound structure is created as follows:

      ignore
      Outbound structure only contains the fields in the inbound structure

      add

      Outbound structure contains all fields from the configuration; the fields missing in the inbound structure are empty.

      error

      Conversion is terminated due to the incomplete inbound structure. An error message is displayed.

      Regards,
      Praveen.

      (1) 

Leave a Reply