Last time, we published a short tutorial on Setting Up A Trading Partner For Automated FTP file transfers. That post was meant to serve as a jump off point for future articles that would demonstrate different automated file transfer processes involving trading partners. Today, we'll make use of what we learned in that post to show you how easy it is to set up a scheduled automatic download if we already have a Trading Partner ready to be called into play.
Once you're done reading this post, I encourage you to drop by the article Scheduling an Automated File Transfer for Files Matching A Regex and scroll down to the part where you specify the trigger action parameters. You'll see how this process is better when you're downloading from a trading partner.
What we're trying to do
Think you could use something like this? Let's begin.
1. Create a new Trigger
Create a new trigger by navigating to the Triggers node and then (under the Triggers tab) clicking the Add button.
2. Select the Current Time event type
As soon as the next dialog comes up, give this trigger a Name, e.g. "Automatic FTP Download".
Choose the Current Time event type from the drop-down list.
Click the Next button when you're done.
3. Schedule this automatic download in a Time Expression
This is the part where we'll specify the schedule for our automatic download. Let's say we'd like the download to commence at 8:30 PM of every first day of the month. The easiest way to do this is through the Time Expression dialog. Click the Time Expression button.
Now, specify the hour (based on a 24-hour clock), minute, and DayOfMonth parameters. Of course, if the other parameters are more suitable for your kind of scheduling, please feel free to use those instead. Click OK when done.
You should then see the resulting Time Expression in the Trigger Conditions box.
Click Next to proceed.
4. Add a suitable Trading Partner download Trigger Action
Now it's time to add a trigger action that would automatically download files once the trigger conditions are met. Click the Add button to proceed.
Expand the drop-down list box and scroll down to the trigger actions for trading partners. They all start with "Trading Partner", so you can just type that and the interface will bring you to where you want to be.
If you just want to download a single file, select "Trading Partner File Download".
But if you want to download several files in one go, then the "Trading Partner Regex File Download" trigger action would be the better choice. As its name implies, this trigger action allows you to use regular expressions to specify the set of files you want to download. In our next step, we'll be using the "Trading Partner Regex File Download" parameters as our example, so I suggest you select that for now.
Not familiar with regular expressions? These posts can give you a nice introduction:
Click the OK button once you're done.
5. Specify the trigger action parameters for this automatic download
If you look at the parameters for this trigger action (see screenshot below), you'll notice that it doesn't include typical information for establishing a connection (which is of course essential for any data transfer) such as the host/IP address, port number, timeout, and login credentials (e.g. username and password).
The reason is because all this information is already stored in the trigger partner. This is what we've been talking about earlier. So if you expand the Partner drop-down list box, you should see all the trading partners you've created. In this example, we're using the trading partner we created in the article Setting Up A Trading Partner For Automated FTP. If you haven't created a trading partner yet, I suggest you read that post first.
Once you've selected your Trading Partner, you can then proceed to fill up the following fields:
Remote Directory - This is the directory on your trading partner's server where you want to download files from. Note that this is a relative path that is based on the home directory of the user account associated with this Trading Partner.
Regular Expression - This is where you enter the regular expression that would pick the files you want to download. In this example, we want to download all .xml files found in the /fordownload directory.
Expression Type - You can choose between Regular Expression and Wildcard. Choose the former for now.
Local Directory - This is the directory on your local machine where you want the downloaded files to be placed.
Leave all other parameters as is for now and then click the OK button.
6. Finalize the trigger creation process
We're now ready to finalize this trigger. Click the OK button to get back to the main screen.
Once you get to the main screen, you should see your newly created trigger.
Important! Don't forget to click the Apply button. Otherwise, those settings won't be saved.
That's it. You now know how to schedule an automatc download with a trading partner.
Want to try this out yourself? Download the free, fully-functional evaluation edition of JSCAPE MFT Server now.