Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline Jon Tofte-Hansen  
#1 Posted : Thursday, September 5, 2019 3:31:55 PM(UTC)
Jon Tofte-Hansen

Rank: Paid support

Joined: 2/4/2016(UTC)
Posts: 101
Denmark
Location: Hovedstaden, Copenhagen

Thanks: 7 times
Was thanked: 17 time(s) in 13 post(s)
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 )

Edited by moderator Wednesday, September 11, 2019 4:40:27 PM(UTC)  | Reason: Not specified

Offline Support  
#2 Posted : Thursday, September 5, 2019 5:11:18 PM(UTC)
Support

Rank: Official support

Joined: 12/1/2015(UTC)
Posts: 151

Thanks: 16 times
Was thanked: 6 time(s) in 5 post(s)
Originally Posted by: Jon Tofte-Hansen Go to Quoted Post
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!
Offline Joey S  
#3 Posted : Tuesday, September 10, 2019 8:52:37 PM(UTC)
Joey S

Rank: Paid support

Joined: 3/26/2018(UTC)
Posts: 9
United States
Location: North Dakota, Grand Forks

Was thanked: 4 time(s) in 3 post(s)
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

Edited by user Wednesday, September 11, 2019 10:49:54 AM(UTC)  | Reason: Not specified

thanks 2 users thanked Joey S for this useful post.
Support on 9/11/2019(UTC), Jon Tofte-Hansen on 9/11/2019(UTC)
Offline Jon Tofte-Hansen  
#4 Posted : Wednesday, September 11, 2019 1:03:44 PM(UTC)
Jon Tofte-Hansen

Rank: Paid support

Joined: 2/4/2016(UTC)
Posts: 101
Denmark
Location: Hovedstaden, Copenhagen

Thanks: 7 times
Was thanked: 17 time(s) in 13 post(s)
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.
Offline thomas  
#5 Posted : Wednesday, September 11, 2019 2:36:14 PM(UTC)
thomas

Rank: Paid support

Joined: 12/10/2013(UTC)
Posts: 443
Norway

Thanks: 21 times
Was thanked: 170 time(s) in 129 post(s)
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 :)

Offline Jon Tofte-Hansen  
#6 Posted : Wednesday, September 11, 2019 3:28:14 PM(UTC)
Jon Tofte-Hansen

Rank: Paid support

Joined: 2/4/2016(UTC)
Posts: 101
Denmark
Location: Hovedstaden, Copenhagen

Thanks: 7 times
Was thanked: 17 time(s) in 13 post(s)
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.

Edited by user Wednesday, September 11, 2019 3:28:45 PM(UTC)  | Reason: Not specified

Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Scroll to Top