Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


rgepfert
2011-09-13T13:34:10Z
I have a job that loads coupons for our system. We get about 5 files at the same time. I set up a VC job to trigger on the file, but when I drop 2 files in the trigger folder, VC only kicks off the job for one file. How do I get VC to fire my job multiple times for multiple files?

Thanks,
Robert
Sponsor
Forum information
ErikC
2011-09-13T13:52:19Z
Hi rgepfert,

You have to put the job in queue mode. 1st tab in the job.

Regards
Erik
Uses Visualcron since 2006.
osirisja
2011-09-13T13:55:06Z
Hi Robert

I had a similar challenge and seemed to get around it by first moving each file to a 'working' directory (Copy File task and remove original) and processing it from there. In the Copy File task I set:

FOLDER - {TRIGGER(Active,LastTrigger,File.Result.TriggerFolder)}
INCLUDE FILE MASK - {TRIGGER(Active,LastTrigger,File.Result.Name)}

And in the Copy Settings Tab, set:

DESTINATION FOLDER - {USERVAR(defcopyfolder)} (defcopyfolder is a user defined variable storing the path of the folder to copy to). Also, here is where you select the option to 'Delete file after copy'.

Then to process the file in subsequent tasks just reference {USERVAR(defcopyfolder)}{TRIGGER(Active,LastTrigger,File.Result.Name)}

No idea WHY it works but now, copying 10, or 20 data files in to the Trigger folder runs the job automatically for each file. It is a bit convoluted but it seems to do the job for me.

Good luck

Andy

osirisja
2011-09-13T14:01:36Z
Hi Erik

I had tried the 'Queue Mode' option as well but VC would only ever process the last data file I had copied in to the trigger folder (i.e. a group of 10 files), hence the reason why I ended up with the process above.

As a benefit of doing this (i.e. moving the file first before processing), you also minimise the (unlikely) risk of a duplicate file name overwriting an existing file name while it is being processed by a task and Copy File task gives you a bit more flexibility in how to handle duplicate files.

Cheers

Andy
Scroll to Top