How do I build/configure call template collections to download and import multiple files from a FTP server?

Hey Sven,

I recommend using M10075 Novulo FTP Calls and responses, which extends component M7899 Novulo Basic Calls and responses.
Furthermore, use 10388 Novulo Call template processes to configure a Novulo process that is executed after the execution of the call.

Once you have installed the latest CTP revisions of the components above, follow the steps of the instructions below:

1. Add a new collection via all settings > call template collections
2. Add a call template at the new collection.
First, we will define a call template for retrieving the list of all files at a certain location. Define a name of your liking and choose the type “FTP”.

  1. Choose the correct ftp server you want to get the files from. This can also be “localhost:21” if the server is equal to the server where the Novulo application is hosted
  2. Define the correct path to the map where you want to get the files from. The path should end with “/”
  3. Choose one of the available authentication methods. If you have a username and password, then choose “Basic”. None is also an option.
  4. Define the content type of the files if needed. This allows for automatic imports later. Currently, only JSON and XML are supported. Leave it empty if you do not download those types
  5. Choose “Get list of files” for retrieving the content of the directory that you defined under 2
    6 7 8 9. Experiment with the correct settings for your specific use case.
  6. Set this checkmark if you want to download all files in the directory
  7. We have to create an additional call template for downloading a single file based on the file names. This new call template need to be set here. This is an example of a call template for downloading a single file:

3. Add a call account and link it to the template
At the call template collection, add a new call account.


Then link this account to both call templates:

4. Execute a test call
Fill in 1 and 2, then click on 3

You should now see multiple new calls that appeared in the call overview at the call template collection. Sort them by ID to see the newest at the top.

Inspect the call record and the responses that are linked to it. The response for the call template for getting the list of files should have a response with a body similar to this:

Then there are separate calls for each file name in this list.
The responses of these calls should each contain a single downloaded file, like so:

5. Configure a call template process
If you can download all files to separate “Response” records, then you can define a process to execute for each of these responses.
Simply importing the file is possible if you define a “sequential import template” at the call template for downloading a single file.
Then, after the import, you might want to process the imported files. You can do so by following the steps below:

  1. Go to the call template for downloading (and importing) a single file.

  2. Add a new call template process

  3. Fill in the required fields:
    image
    (1) The correct trigger is “After processing” if you want your process to start after the import
    (2) Here you have to choose your custom “Novulo process”. If it does not show up, add a new “process action definition” under all settings for your process. Do not forget to click the button for determining the parameters and return values:


    (3) You can define a condition for when the process should/shouldn’t be executed. Leave it as true for now.

  4. Now, “Call template process parameters” should have appeared in the grid below. These are the parameters that you defined in your custom process. Edit them and set an expression that will result in the desired outcome.
    image

  5. In the example case, only one input parameter is required, a response. The context for the expression to define the input parameters is the “response” that has been created by the call. So for example if we just dowloaded 1 file, then it is saved at new response record with, for example id 123. We can access all data of response with id 123 to find the correct inputs for our custom process.
    In the example I defined a process that only needs a single response as an input, so I pass the context-response to it by setting the expression simply to “this”.
    image

Now go back to step 4. Execute a test call to test out whether your custom process works correctly.

1 Like