Filesystem Adapter
The Filesystem adapter gives you access to the filesystem in service context. You can read and write files (even incrementally), and read and create directories.
Find below a table listing some common tasks you can use the Filesystem adapter for, and which action to use for which task.
Task | Action | Mode | Important Parameter | Remarks |
---|---|---|---|---|
Write a complete file in one action. |
| |||
Replace part of a file. | position | Writes the data to the file beginning at the specified position. If the file does not exists you will get the exception FSADM/8 (see Catching Errors). | ||
Append data to a file. | append |
| ||
Write a complete file line by line. | overwrite | Use mode overwrite for all appends.
overwrite will only be applied to the first append. All subsequent appends (e.g. in a loop) automatically get mode append. | ||
Copy a complete file. | Copy a file in one action. Using copy you can even copy huge files because it does not load the complete file into memory. | |||
Move a file to a new location. | newName | Provide the new path of the file through the newName parameter. | ||
Delete a file. | If the specified file does not exist, no error will be reported. | |||
Manipulate a file and process the file further (e.g. moving it). | Before processing the file further (e.g. moving it), close the file. Otherwise it may be locked. |
Adding a Filesystem Adapter Operation to a Diagram
Expand the path to the Filesystem adapter in the service panel (Base Types/Bridge Base/Base Components/Add Ons/FileSystem):

You can drag out operations from the data model to any diagram:
The example shows how to add a Filesystem adapter operation to a BPMN execution diagram:

Configuring the Filesystem Adapter Operation
Once an operation has been added to a diagram, it needs to be configured as a Filesystem adapter.
Select the newly added Filesystem adapter operation and switch to the Attributes panel:

The following attributes are predefined and cannot be changed:
Attribute | Description | Allowed Values / Examples |
---|---|---|
Name | The name of the Filesystem adapter operation. | createDirectory |
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 Filesystem adapter:

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

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

Alias: A Filesystem adapter is configured via its alias. For more information see below.
Mode: This option is only relevant for append operations.
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

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

Refer to Filesystem Adapter Reference for further 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:

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