Written for Frends version 5.6
Prerequisites
You will need the following prerequisites to follow through with this guide:
Editor access to your Frends Tenant to access the Process editor view.
An Agent Group and Environment setup up to run Processes.
Tasks called 'Frends.FTP.UploadFiles' and 'Frends.FTP.DownloadFiles' imported to your Frends Tenant.
Target and source (S)FTP server that stores the files. If you don't have own server, you can use free speedtest.tele2.net server available for testing.
Creating a Process
A new Process can be created by navigating to the 'Processes' view and clicking the '+ Create new' button. A Process can only be created in the Development Agent Group.
Add a Scheduled Trigger
We are going to configure our Schedule to run every 15 minutes.
Drag a Start shape to the canvas from the BPMN toolbar.
Select 'Schedule' from the 'Type' dropdown in parameter editor on the right side of the canvas.
Change the state of 'Is repeated every' to 'Yes' and fill in 15 minutes into the interval selector.
Leave the 'Run only one scheduled instance at a time.' as Yes. In case of slow file transfer speeds we do not want to start a new Process instance before the previous one is complete.
Add FTP handler task
The next step in creating a Process is to add a Task that can fetch the file from the source FTP server. We are going to use Tasks called 'Frends.FTP.DownloadFiles' and 'Frends.FTP.UploadFiles'. The FTP Tasks can handle FTP uploads and downloads. If you need to transfer to or from a SFTP server, you need a Tasks called 'Frends.SFTP.DownloadFiles' and 'Frends.SFTP.UploadFiles'.
For a detailed documentation about these Tasks you can checkout:
For this example we are going to configure information under 'Source' and 'Destination' tabs in both Frends.FTP.DownloadFiles and Frends.FTP.UploadFiles Tasks. For these Tasks to work you need a local storage for the files where they are been stored during the transfer.
Following configuration will download a file named 10MB.zip to a local file storage and change it's name to file.zip. Environment Variables are used to store server address and login information. If you use tele2's server address is speedtest.tele2.net
and username is 'anonymous' and password can anything you want.
With Frends.FTP Tasks the connection parameters are in their own tab.
Next we need to configure the UploadFiles Task which will upload the file from the local file storage to the FTP server. We will set the source Directory the same as the DownloadFiles Task's Destination Directory and the file name as the renamed file name.
We can change the name of the file by setting the new file name to the Destination File name parameter. If you are transferring multiple files it's usually better to use macros with the file name e.g. {{DateTime.Now.ToString("yyyyMMdd")}}_%SourceFileName%%SourceFileExtension%
The Connection parameters we can set the same as with the UploadFiles Task.
Reporting how many files were transferred
FTP Tasks can return different information about the files that were processed. In our case we are interested in the amount of files transferred. We are going to add a Promoted Variable for the count of files so that we can later create a Monitoring alert to notify us if not enough files have been processed.
The FTP Tasks #result object contains a property called 'SuccessfulTransferCount' we are going to promote that value from the Process execution.
Best Practices
Use Environment Variables for storing constant information that can be shared across Processes. In this case for example FTP server address and FTP password.
Next learn how to make second simple integration process: Read CSV and transform it to XML.