Configure Dynamic Decryption in OIC Based on IsEncrypted schedule Parameter
Use Case
A business receives both encrypted and plain files from an SFTP server. To process both type of files, the integration will use a schedule parameter (IsEncrypted), which will be set to:
'Y' → If the file is PGP encrypted and needs decryption.
'N' → If the file is plain text and does not need decryption.
Goal
- Download the file using the SFTP Adapter.
- Dynamically set the "Decrypt File" option in the Stage File action using the
IsEncryptedparameter from the mapper. - If
IsEncrypted = 'Y', enable PGP decryption by setting"true". - If
IsEncrypted = 'N', do not decrypt the file ("false").
Step-by-Step Configuration
1. Add the SFTP Adapter to Download the File
- Drag and drop the SFTP Adapter in the integration.
- Select Download File operation.
- Configure SFTP details (host, authentication, file directory, etc.).
- Store the file in Stage File for processing.
2. Add a Stage File Action to Read the File
- Add a Stage File Action after the SFTP Adapter.
- Select Read File operation.
3. Configure Decryption Dynamically in the Mapper
- Click on Mappings in the Stage File Read action.
- Locate the "Decrypt File" field in the mapping.
- Set the value dynamically using the
IsEncryptedparameter:
Expression in Mapper (If-Else Condition)
if ($IsEncrypted = 'Y') then 'true' else 'false'
- This ensures that if
IsEncrypted = 'Y', decryption is enabled ("true"). - If
IsEncrypted = 'N', the file is read as is ("false").
4. Select PGP Key for Decryption (If Needed)
- If decryption is enabled (
true), configure:- PGP Private Key (Uploaded in OIC Security).
- PGP Passphrase.
5. Process the Decrypted or Plain File
- Store the file in Object Storage, Database, or another system.
- Use OIC File Adapter, REST API, or another SFTP Adapter to move/process the file.
Screenshots:

No comments:
Post a Comment