84 / 166
How to parse flatfile?
Step 1: Create Appropriate Flat File Schema
Create a flat file schema to be used for conversion and validation of the document. Here we have first create a dictionary and then same set in schema.
Step2:Receive the Flat File
Invoke the pub.file:getFile service to retrieve the file from the local file system.
Step3 : Parse Flat File Data to an IS Document
To parse a flat file using a flat file schema, and to convert the data into IS documents. We can call the convertToValues service.
Step 4: Process the IS Document
Now we can process IS document .As per the requirements we can map the data.
·In the Developer Navigation Panel, select the saved flat file schema, click the Flat File Structure tab, and then click Icon ‘Create Document Type’. This creates an IS document type in the same folder as the schema with the same name of Schema name. On the Pipeline tab under Service In, in the ffSchema variable specify the location and name of the flat file schema.
·Perform the following to add a Document Reference to the IS document type that is based on the flat file schema.
On the Pipeline tab click under Pipeline Out, Select Document Reference to add a new document reference variable or else choose the IS document type created in step 1 of this procedure .
·On the Pipeline tab under Service Out, map the value of the ffValues variable to the·document reference variable created in this procedure and save the service.
Asked In ::
Step 1: Create Appropriate Flat File Schema
Create a flat file schema to be used for conversion and validation of the document. Here we have first create a dictionary and then same set in schema.
Step2:Receive the Flat File
Invoke the pub.file:getFile service to retrieve the file from the local file system.
Step3 : Parse Flat File Data to an IS Document
To parse a flat file using a flat file schema, and to convert the data into IS documents. We can call the convertToValues service.
Step 4: Process the IS Document
Now we can process IS document .As per the requirements we can map the data.
·In the Developer Navigation Panel, select the saved flat file schema, click the Flat File Structure tab, and then click Icon ‘Create Document Type’. This creates an IS document type in the same folder as the schema with the same name of Schema name. On the Pipeline tab under Service In, in the ffSchema variable specify the location and name of the flat file schema.
·Perform the following to add a Document Reference to the IS document type that is based on the flat file schema.
On the Pipeline tab click under Pipeline Out, Select Document Reference to add a new document reference variable or else choose the IS document type created in step 1 of this procedure .
·On the Pipeline tab under Service Out, map the value of the ffValues variable to the·document reference variable created in this procedure and save the service.