Downloading Files Periodically From A Trading Partner

Posted by John Carl Villanueva on Thu, Feb 25, 2021 @ 02:25 AM

[Last updated February 2021] In this post we're going to show you how to download files periodically from a trading partner. For this particular example, we'll be setting up JSCAPE MFT Server to connect to a trading partner every 10 minutes, download all files from a particular folder, and then delete each of those files from the remote server as soon as the download succeeds. 

periodic download.png 

 

Prefer to watch a video version of this instead?

 

 

 

 

We'll be assuming you already have an existing trading partner object configured on your JSCAPE MFT Server instance. The trading partner can be pointing to almost any file transfer server, including AFTP, FTP, FTPS, SFTP, Amazon S3, Azure Blob and many others. If you're not familiar with trading partners in the context of JSCAPE MFT Server, we suggest you watch the video: Using Trading Partners

 

download files periodically from trading partner - 01

 

Once you have a trading partner object set up, create a new trigger. For those who are not yet familiar with triggers, watch the video: Automating File Transfer Processes Using Triggers.

Give the new trigger a descriptive name, say "tp-s3 10 minute periodic download and delete".

After that, select the Current Time event type. 

Click Next to proceed.

 

download files periodically from trading partner - 02

 

Because we want this trigger to fire every 10 minutes, we need to write an expression for that. You may write the expression manually but the easiest way would be to use the Time Expression tool. Tick the Override checkbox and then click the button labeled Time Expression to launch that tool...

 

download files periodically from trading partner - 03

 

and then, in the Minute text field, enter 0,10,20,30,40,50. 

 

download files periodically from trading partner - 04

 

After clicking OK, JSCAPE MFT Server will automatically generate the corresponding expression in the Trigger Conditions box like so. Click Next to proceed.

 

download files periodically from trading partner - 05

 

We're now ready to add the trigger action that would connect to your trading partner, download all files from a particular directory, and then delete each file after each successful download.

Click the Add button to add that trigger. 

 

download files periodically from trading partner - 06

 

For this purpose, we'll need the Trading Partner Regex File Download trigger action. Select that from the drop down list and then click OK

 

download files periodically from trading partner - 07

 

As soon as the trigger action parameters dialog appears, select the trading partner from the Partner drop down list. 

You will also have to specify the remote directory or subdirectory which you will be downloading files from.

Because we want to download all files, just enter *.* into the regular expression field. If you want to download specific sets of files, then you'll have to enter the appropriate regular expression into that field. 

Now, because we're using *.*, we'll need to select Wildcard for the Expression Type. Otherwise, select Regular Expression.

You'll also need to specify the Local Directory into which the downloaded files will be stored. You may use the Browse tool to select the desired directory in your local file system.

Lastly, because we want to delete each downloaded file from the remote directory, tick the Delete on Success checkbox.

Click OK to proceed.

 

download files periodically from trading partner - 08

After clicking OK, you'll be brought back to the Add Trigger screen, where you should see your newly created trigger action. Drag an arrow from the Start output of the Workflow node to the Execute input of the newly added trigger action node.

For more information about creating trigger action workflows, read the post:

Introducing the Redesigned Trigger Action Workflow

 

download files periodically from trading partner - 09

 

Click OK until you're back at the main screen.

 

download files periodically from trading partner - 10

 

That's it. Now you know how to configure JSCAPE MFT Server to carry out periodic downloads from a trading partner. 

Get started

Want to try this out? Download the free, fully-functional evaluation edition of JSCAPE MFT Server

 

Download Now

 

 Want to be updated on posts like this? Connect with us...

 

 

Topics: JSCAPE MFT Server, Business Process Automation, Triggers, regular expressions