All;
I have a job that runs every 15 minutes. If the job fails it sends an email to a support group to notify of the issue. I want to build a condition loop that bypasses the email notification if the email has already been sent within the hour. On the job executions in the subsequent hour reset the variable to allow a failed transaction to send the email.
I presume I could create two jobs and have specific job intervals for each where the one that runs hourly sends the email on a failure and the job that runs at the 15,30, and 45 interval will not send an email. That does not seem very elegant and it seems as though with all of the features of VisualCron between Job variables, User Variables, Conditions, and Job Flow that I could do this with 1 job.
I would like a solution that could be used for a job that may run every 5 minutes where the above solution would be very tedious and a programatic solution may be a little challenging.
Maybe this:
- Set a JobVariable to define the interval to check notifications
- on start of the job check a DateDiff of current date against a date UserVariable
- If diff is greater than JobVariable then reset the UserVariable to NULL
- Execute task
- On success flow, check UserVariable is not NULL then go to Reset UserVariable to NULL task and exit
- On error flow, check UserVariable if NULL then go to Email task; otherwise, End Job
- After Email Task set UserVariable to current timestamp
Has anyone done Something like this yet?
What was your solution?
Thanks
Edited by moderator
2017-07-31T21:42:57Z
|
Reason: Not specified