🔧 File Server Action in OIC 25.x
The File Server Action enables you to interact with the embedded File Server in OIC, facilitating operations such as listing directories, reading files, writing files, moving files, and deleting files.
Supported Operations:
1. List Directory
Retrieves a list of files and subdirectories within a specified directory.
Note: Supports listing up to 1,000 files per operation.
2. Get File Reference
Obtains a reference to a specific file, which can be used for further processing within the integration.
3. Write File
Writes content to a specified file on the File Server.
Useful for creating new files or updating existing ones.
4. Move File
Moves a file from one directory to another within the File Server.
Helps in organizing files post-processing.
5. Delete File
Deletes a specified file from the File Server.
Useful for cleanup operations after processing.
🛠️ Implementing File Server Actions in an Integration
To utilize the File Server Action:
1. Enable File Server:
Ensure that the File Server is enabled in your OIC instance.
2. Create or Edit an Integration:
In the integration canvas, click on the "+" icon to add a new action.
Select "File Server Action" from the list of available actions.
3. Configure the Action:
Choose the desired operation (e.g., List Directory, Write File).
Provide necessary parameters such as directory paths, file names, and content as required by the operation.
4. Map Inputs and Outputs:
Use the mapper to define how data flows into and out of the File Server Action.
5. Test and Deploy:
Test the integration to ensure the File Server Action performs as expected.
Deploy the integration for production use.
📘 Example Scenario: Processing Supplier Invoices
Objective: Automate the retrieval and storage of supplier invoices.
Workflow:
1. List Directory:
Use the File Server Action to list all invoice files in the /invoices/pending directory.
2. For Each File:
Get File Reference:
Obtain a reference to the current file.
Process File:
Read and process the file content as needed (e.g., extract data, validate).
Move File:
After successful processing, move the file to the /invoices/processed directory.
Delete File:
Optionally, delete the original file from the /invoices/pending directory to prevent reprocessing.
By leveraging the File Server Action in OIC 25.x, you can streamline file-based operations within your integrations, reducing the need for external tools and simplifying your workflows.
File Server vs Ftp/sftp connection:
File Server (OIC 25.x) is lighter on message pack, faster, more secure, and ideal for internal automation.
SFTP Adapter is useful only when external connectivity is required, but comes with higher message consumption, slower performance, and more monitoring overhead.
No comments:
Post a Comment