Skip to main content
Skip table of contents

Flat File Adapter

A flat file is a file that contains no information about the structure of the data. Any types of flat files can be read and parsed into a class structure using the Flat File Adapter. The structure of the flat file has to be defined in with classes and properties in the data model of your service. Any record definitions, separators and even dependencies between different records can be defined there.

For manipulating files and directories in general, have a look at the Filesystem Adapter.

General Approach

A flat file is a file that contains no information about the structure of the data. The most simple flat file is a position delimited file without header or trailing lines. More complex flat files can have a field delimiter, or can be of hierarchical structure, or can have a pattern to delimit the attributes. If you want to access such a file, you need information about the file structure, and build that structure in the data model of your Designer service.

The screenshot below shows the flat file used in the example. This file has a header line and the records are numbered.

The class diagram below shows the data structure that reflects the structure of the file. Refer to Defining a Flat File Data Structure for more information on how to build such a structure.

Flat files can be parsed to a data structure or composed from such a structure to a Blob or to the file system.

Limitations

When working with the Flat File adapter, please note the following limitations:

  • The size of one record within a flat file is limited to 4 MB. The size of the file itself is not limited.

  • Be aware, that the Flat File Adapter will parse the file all in once. If you need to process big files, it may be better to process them line by line to save resources during execution.

Do do this, use a combination of Filesystem Adapter (to read one record) and Flat File Adapter (to parse the record).

Adding a Flat File Adapter Operation to a Diagram

Expand the path to the Flat File adapter in the service panel (Base Types/Bridge Base/Base Components/Add Ons/FlatFile):

You can drag out operations from the data model to any diagram:

The example shows how to add a Flat File adapter operation to a BPMN execution diagram:

grafik-20250530-092231.png

Configuring a Flat File Adapter Operation

Once a parse or compose operation has been added to a diagram, it needs to be configured as a Flat File adapter.

Select the newly added Flat File adapter operation and switch to the Attributes panel:

grafik-20250602-122255.png

The following attributes are predefined and cannot be changed:

Attribute

Description

Allowed Values / Example

Name

The name of the Flat File adapter operation.

compose

Description

If provided, you can find a description of the operation in this field.

Is static

Indicates that the operation is static.

Click Add in the Extensions line to define the selected operation as to be a Flat File adapter:

grafik-20250602-122344.png

Search for the Flat File Adapter and select it from the list of available adapter extensions. Click Next:

grafik-20250612-065405.png

In the next window, you can configure the adapter. You have the following options:

grafik-20250612-065533.png

Alias: You can add a file or directory alias to the adapter operation to specify the file to be parsed from or composed to.

Regarding the alias, you have two options:

  • Use the drop-down list to select an available alias.

  • Use the + to create a new alias.

If you create a new alias, you first have to choose the alias type:

  • Directory

  • File

grafik-20250530-092757.png

Click Next to display the configuration options of the chosen alias type:

grafik-20250530-092912.png

Refer to Flat File Adapter Reference for more information on the configuration options of this adapter and its two different types.

Click Save to create the alias and add it to the extension.

Refer to Aliases for more information on how to create a new alias.

Save the adapter configuration. The Attributes panel now shows the added adapter extension.
If you want to remove an alias from an extension, select None from the drop-down list:

grafik-20250612-065709.png

FlatFileAdapter_ProductExport_Example

Click here to download a simple example model that shows the usage of the Flat File adapter in Scheer PAS Designer.

Related Content

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.