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


Jon Tofte-Hansen
2019-09-05T13:31:55Z
Tested on VisualCron 8.5.5.

I was testing some job queuing when I experienced this:

Setup:
*A job with a file trigger
*A wait task (10 seconds)
*A copy file task (move) where the field "Include file mask" is set to "{TRIGGER(<job guid>|<trigger guid>|File.Result.Name)}"
*5 testfiles copied to source folder to trigger the job

Result:
Only the first file discovered was moved to the destination folder because the dynamic file name in the trigger variable was not updated.

When I deactivate the wait task all files are moved as expected.


(Allow me to repeat the fact that new files arriving when VisualCron is down are not processed at startup: https://www.visualcron.c....aspx?g=posts&t=9248  )
Sponsor
Forum information
Support
2019-09-05T15:11:18Z
Originally Posted by: Jon Tofte-Hansen 

Tested on VisualCron 8.5.5.

I was testing some job queuing when I experienced this:

Setup:
*A job with a file trigger
*A wait task (10 seconds)
*A copy file task (move) where the field "Include file mask" is set to "{TRIGGER(<job guid>|<trigger guid>|File.Result.Name)}"
*5 testfiles copied to source folder to trigger the job

Result:
Only the first file discovered was moved to the destination folder because the dynamic file name in the trigger variable was not updated.

When I deactivate the wait task all files are moved as expected.


(Allow me to repeat the fact that new files arriving when VisualCron is down are not processed at startup: https://www.visualcron.c....aspx?g=posts&t=9248  )



Thanks for reporting this.

Could you export this job and send to support@visualcron.com so we can try to reproduce this, please?

Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
Joey S
2019-09-10T18:52:37Z
You can't use that variable name, that will result in seeing only the first trigger and not subsequent ones. Your first file will be moved (copied) but the job will run the number of times equal to the number of files you give it. So if you have the variable the way you do and add 5 files to the folder being watched, you will run the job 5 times and copy the first file each time

You need to use the Last Trigger result. That uses the last trigger that made the job activate. I think you can throw 30 files at it at once, after that you will get an error.

Example: {TRIGGER(d55f456b-3661-4ff4-8cf4-7d1d64096c46|LastTrigger|File.Result.Name)}

For the variable location look to: Variables - VisualCron Variables - Jobs - Active Job - Triggers - Last Trigger - Then scroll down to File - Result - Name
Jon Tofte-Hansen
2019-09-11T11:03:44Z
Thank you Joey S!

My test case works when using the {TRIGGER(<job id>|LastTrigger|File.Result.Name)} variable.

Is this considered common lore in the community? I don't find the path to that specific variable rather intuitive.
thomas
2019-09-11T12:36:14Z
I guess there are two ways of thinking about a file trigger. If you dump 10 files in a monitored folder, you could have two ways of solving it:

1) The trigger is fired once, and contains a list of 10 files

2) The trigger is fired 10 times, each of the containing one file.

VisualCron uses the second method, and for good reason i think. If there is a tiny lag between the time files are dumped into the folder, method 1 is going to get messy very quickly.

To me it makes sense with variable name LastTrigger. If that is what you meant :)

Jon Tofte-Hansen
2019-09-11T13:28:14Z
After some testing and thinking:

As far as I can comprehend, the two variables represent two different pieces of information:

  1. {TRIGGER(<job id>|LastTrigger|File.Result.Name)} gives you the filename triggering the current execution.
  2. {TRIGGER(<job id>|<trigger id>|File.Result.Name)} gives you the filename of the last triggering event. (I know this is different from Joey S's explanation)

The two will only be different while the job is running (who would ever deliberately use number two?).

So my misunderstanding was due to the "Last trigger" naming of the path [VisualCron variable]/[Jobs]/[Active job]/[Triggers]/[Last trigger] and the variable parameter name "LastTrigger". For me at least, I think "current execution" or "current context" would be more intuitive.

Anyway, now I know that "LastTrigger" is what I need, so thank you for clarifying that.
Scroll to Top