KB Article #181741

ADVANCED ROUTING: Send a single trigger file for multiple uploaded files

Problem

I configured an Advanced Router application with a Route with Send to Partner Step. In the Send to Partner step, I have enabled Send Trigger File and I have configured the remaining settings. However, I get a trigger file generated for each file I upload in the subscription, but I only need a single trigger file for all files.


Resolution

In the Administrator's Guide is stated that after a successfully uploaded file to the Advanced Router Subscription, this will trigger the Subscription (if the checkbox Trigger processing of files based on condition is not checked), this file will be placed in the sandbox folder from where it will be processed from the Route Steps. The trigger file is created after successful incoming transfer in the sandbox folder.


If you upload one file, the Advanced Router Subscription will be triggered only once, one sandbox folder will be created and one trigger file will be sent after the original file is processed. But if you upload 2 files in the Advanced Router Subscription, this will trigger the subscription twice, once for each of the files, because the check box Trigger processing of files based on condition is not checked. This process will create 2 sandbox folders, 2 trigger files will be created and they will be sent after the files are routed.


You can achieve the single trigger file in 2 ways.



First solution

Use a trigger file to trigger the Subscription (which triggers the AR, which generates the final trigger file we need).


Create a Route from Accounts → User Accounts → username → Routes which has a Send to Partner step.


In the Send to Partner Step enable Send Trigger File.


Add a Trigger File Name. Trigger File Content is optional.


Set the Trigger File Destination(s) settings.


Save the Route.



Trigger file configuration in the Step



Add an Advanced Route Subscription and assign the Route from Step 1.


Enable Trigger processing of files based on condition in the current Subscription.


Under Trigger condition add an expression for evaluation, for example:


${stenv['target'].matches('.*.trigger')?1:0}


Under Submit for processing select the All files in the subscription folder option.


Save the Subscription.



Subscription configuration



Multiple files can be uploaded into the subscription folder now. Once all are done, one additional trigger file needs to be uploaded – the filename.trigger. When ST receives it, it will match the file against the trigger condition above, and recognize it as a signal to start processing the files.


The AR will distribute the files as configured and since it was executed just once for all files in the subscription folder, it will generate one single trigger file and then send it according to the Trigger File Destination(s) settings.



Second solution

This solution requires that the partner archives the files into one single file (a .zip file for example) and then upload it to ST. Then we can use a Decompress step before the Send to Partner step with the trigger file.


Create a Route from Accounts → User Accounts → username → Routes which has a Decompress step.




Add a Send to Partner Step.


In the Send to Partner Step enable Send Trigger File.


Add a Trigger File Name. Trigger File Content is optional.


Set the Trigger File Destination(s) settings.


Save the Route.



Trigger file configuration in the Step



The order of Steps in the Route must be 1. Decompress and 2. Send to Partner.




Add an Advanced Route Subscription and assign the route from Step 1.




The sending party needs to upload the files in a compressed format – in a .zip archive for example.


The AR will pick up the archive, decompress it and then send out the contained files via the Send to Partner step. Since it was executed just once for .zip file in the subscription folder, it will generate one single trigger file and then send it according to the Trigger File Destination(s) settings.