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


BobJ
  •  BobJ
  • Paid support Topic Starter
2014-08-01T19:52:52Z
If I have multiple tasks in a job (in my case three tasks, (1)rename incoming files, (2)copy rename files to two different locations and (3)send email with copy of file as attachment), should it finish the first step before moving on to the 2nd? It appears the file rename is not complete when it attempts to copy files.

If I upload 3 files to the watched directory, I ultimately end up with 5 files.

So if my upload directory contains:
123456-MMRODetermination.pdf
234567-MMRODetermination.pdf
345678-MMRODetermination.pdf


The files are properly renamed in that directory to:

123456-MMRODetermination-20140801140832.pdf
234567-MMRODetermination-20140801140834.pdf
345678-MMRODetermination-20140801140836.pdf


but these files exist in the locations I'm attempting to copy the files to in task 2:

234567-MMRODetermination.pdf
345678-MMRODetermination.pdf
123456-MMRODetermination-20140801140832.pdf
234567-MMRODetermination-20140801140834.pdf
345678-MMRODetermination-20140801140836.pdf

The only thing I can think is that the rename process hasn't completed before the files are copied, so the files with the original names still exist when the copy process comes along. If that's the case, how can I make the rename task complete to completion before moving on - or is something else going on?\

Thanks
Sponsor
Forum information
BobJ
  •  BobJ
  • Paid support Topic Starter
2014-08-01T19:59:42Z
oh and by the way, the job itself is set to "run tasks in order".
Support
2014-08-02T13:12:24Z
It sounds like you do not use the File Trigger Variables properly (and maybe use a wild card somewhere). Please look at the tutorial  for the File Trigger.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
BobJ
  •  BobJ
  • Paid support Topic Starter
2014-08-03T19:53:23Z
Sorry to be a pest, but I'm missing something in the copy task. I reviewed the tutorial and I understand the concepts, but regardless of what I've attempted it won't work correctly. It seems the problem has to be with the source file name/mask the copy task is using.

I put a wait task in the job - after the rename, just to slow things down a bit. I can see that if I put four files in the watched directory, it renames the first one, then goes on to copy all the files in the directory being watched - those still with original file names and those that have already been renamed. Then then next file is renamed and once, again, all the files are copied again.

If its going to rename one by one, then I want to zero in on just that renamed file name.If I try to modify the filemask of the copy task, I can't seem to hone in on the single file that has just been renamed - it must either be returning the equivalent of *.* or nothing (in which case I get a file copy error).

I also copied the job and left just the rename step in the first job and then set up a file trigger to watch for renamed files in the second job. If it's allowed to run realtime, the same behavior occurs (all files get copied - including those that haven't been renamed yet) instead of copying the single file that has been renamed. If I inactivate the 2nd job and then run it manually after all the renames have completed, it then works exactly like I want it to - only the renamed files are copied to their new locations.

What should I be using for the copy task filemask to get just the filename of the file that has been most recently renamed and not all files? Thanks again!

ErikC
2014-08-04T08:34:47Z
Hi BobJ,

Your job should have this setting:

Do not run job if it's running
Put Job in queue
Run tasks in order

Now use in your tasks the variable {TRIGGER(Active|LastTrigger|File.Result.Name)} for the filename.

So if you put in 4 files at the same time, the job will run 4 times, each time with a different value in the variable mentioned above.

So do not use any asterisks (*) in your copy/rename tasks.

Hope this helps.

Regards
Erik
Uses Visualcron since 2006.
Scroll to Top