Community forum

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


jens
  •  jens
  • No customer Topic Starter
2011-03-22T03:39:50Z
Still relatively new to VC.

Is it possible to add a trigger to a job that will cause it to re-run itself until a condition is met?

I have a job that sends one email at a time based on sql data. The first task gets a particular key, the next gets the email address associated with that key, the next builds the email body, the next sends the mail... each of the results go into the email task as variables. The final task updates the database to note that the email was sent for that key, making it ineligible for selection on next run.

(subquestion: within VC, is there a better way to do this when there might be many emails to send? I could do with SSIS and have VC trigger the job, and might do that, but it's easier for maintenance if it stays in VC).

The main problem with this is the trigger. I don't want to trigger this job to check for new data every 20 seconds. New data only comes up a few times a day. But sometimes it gets backed up -- dozens or possibly hundreds of emails need to go out, and each one goes with a single time trigger click, one every 2 minutes. OK, this is silly.

I'd love to have it check every two minutes, and, if the job ran through, start over! Keep running! Then, when the result of the first task is 0, quit and wait for the next time click to keep checking.

Suggestions?
Sponsor
Forum information
ErikC
2011-03-22T08:06:27Z
Hi Jens,

Nice to have you here at te forums!

You could ad an extra task as the last step in your job. This task is a VC control task and you can set it up to go to the 1st task in your job and run all the tasks again.
You also will need a condition on the 1st task, which is getting the key. This condition should be configured to stop the job if there is no key returned.
So you still have the 2 minutes trigger, but after a whole run, the job will rerun till there are no keys left to process.

Hope this helpes you to solve your issue.

Regards,
Erik
Uses Visualcron since 2006.
jens
  •  jens
  • No customer Topic Starter
2011-03-22T19:36:35Z
This seems perfect!

However, I keep getting errors. If I try to simply run the job (with the "run synchronous" box checked or unchecked) I get an error that the job was not started according to user settings. If I try to run the first task again, it says that the task was not started.

Not sure why I get those errors? Running v5.6.9.

Thanks for your help!
ErikC
2011-03-22T21:12:31Z
Hi Jens,

I'm not at a computer with VC at the moment, but I think you have to setup the job to run in queue mode. This is done at the 1st screen in the job.

Regards
Erik
Uses Visualcron since 2006.
jens
  •  jens
  • No customer Topic Starter
2011-03-23T22:11:49Z
Yes! Works perfectly. Thank you!
Scroll to Top