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


bbusse
2012-11-01T16:03:50Z
I have a request from one of our business units to send a failure notification if any of the tasks in a job fail, but if none of the tasks fail, send a success message.

Job consists of 5 copy steps

Task1: Copy FileA to Destination A
Task2: Copy FileB to Destination B
Task3: Copy FileC to Destination C
Task4: Copy FileD to Destination D
Task5: Copy FileE to Destination E

I have a Generic Notification that is enabled for all 5 tasks upon failure of any kind, and these work. This notification is to be used for any failures for jobs that this Business Unit wants notifications on, so the message i'm sending is identical to other BU's notifications aside from the Recipeient list.

=========================
The following Job/Task had an issue. Contact "Tech Support" with the following information:
JOB NAME: {JOB(Active|Name)}
TASK NAME: {TASK(Active|Name)}
SERVER NAME: {COMPUTER(Name)}
=========================

However, I want to also have an "Overall Job" success email sent out if the entire job (all 5 tasks) were successful. If ANY of the 5 tasks failed and sent a notification, I need to NOT send the Success.

I tried adding a 6th task that has a Condition that says Previous Job status = 0, but that doesn't appear to do the trick. They got a failure AND a success today when one of the 5 steps failed.

Anyone have a suggestion on how to do this using an equally generic Success message and/or simple generic Condition that other jobs could use regardless of the number of tasks?

Really, what i'm trying to avoid is putting a very large number of job-specific conditions in the 'Conditions' list. It is messy to me. I see no way to make Job specific conditions not show up as something you can choose for other jobs, so I didn't go the specific condition route.

Brian
Sponsor
Forum information
Support
2012-11-02T09:54:59Z
Not sure I understand. You have the Error Notification which will send a message if any Task fails. And you have the Success Notification which will send a message if all works. What, besides of this, is needed?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2012-11-02T12:22:55Z
Originally Posted by: Support 

Not sure I understand. You have the Error Notification which will send a message if any Task fails. And you have the Success Notification which will send a message if all works. What, besides of this, is needed?




The problem is that one of the 5 tasks failed, and sent the failure notification, and then the Success e-mail went out ALSO. The Success notification should NOT have gone out, becuase one of the 5 tasks had an issue.

I only want to send a Success Notification if EVERY task in the job completed successfully.

For Notifications I only seem to have the option for 'Started', 'Error', or 'Completed'. It would be extremely helpful if there was an overall job 'Success' option.

I tried adding a 6th task that was an Send Email task, that had a generic condition saying 'Previous Job returned 0', but That appears to not work. If one of the tasks failed, I don't consider the job 'successful', so the e-mail shouldn't have gone out, but it did.

I know I can add a condition set that has all 5 copy tasks being successful before the 6th task can run, but I was trying to avoid creating job-specific conditions just for sending overall success messages.

Hopefully that makese sense.

Brian
bbusse
2012-11-02T12:53:27Z
By the way, I haven't tested this, but is my problem that when a task has an error, I still continue to the next task in order? I still want all tasks to run regardless if one or two fail.

Even though I don't consider the job a success after one or more tasks fails, these copy tasks are technically independant of eachother, so even if one fails, I still want the others to try.

The goal was to simply send one e-mail per 'Job Run' saying 'Success' for this job, but if any of the tasks failed they want an e-mail with details about each task that failed. If they see an overall Success e-mail along with these failures, its confusing.

I want the department to get an e-mail for each task that fails. So, they might get one failure notification, or 5 failure notifications, but under no circumstances should they also receive a Success message if ANY failures were sent for the job.

Brian
Support
2012-11-02T12:59:35Z
So, you have the Success Notification, that one you put on the Job, not individual Tasks.

An on Task level you set "Continue to Next Task" in the On error tab.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2012-11-02T13:08:47Z
Originally Posted by: Support 

So, you have the Success Notification, that one you put on the Job, not individual Tasks.

An on Task level you set "Continue to Next Task" in the On error tab.



That sounds correct to me. Will this not work? Am I causing the job to not actually show an error condition if I just tell the past to continue?

Brian
Support
2012-11-02T13:11:24Z
I just meant, in my last post, is that you should use it that way. It should work. No Conditions needed.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2012-11-02T13:33:23Z
Originally Posted by: Support 

I just meant, in my last post, is that you should use it that way. It should work. No Conditions needed.



I don't understand how I could have a 6th Task (an e-mail task) ready to send a success e-mail without conditions attached to it. If 1 or all of the previous tasks failed, when it gets to task 6 its going to send the success e-mail anyway without some sort of condition attached to it.

Is there a condition that i'm not aware of that is capable of saying 'All previous tasks, in active job' returned 0/success?

I'm looking at the job right now on our server and the Job Result = Success. However, if you expand the job and look at the tasks, one of them has an error in the result "Exception in Task: No file(s) copied". How does the job still have a result of 'Success'?

Does the Job result not get affected negatively if the tasks are set to continue to the next task on error?

Brian
Support
2012-11-02T15:01:45Z
I was thinking about using Notifications and not the Email Task - then you don't need Conditions.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2012-11-02T15:13:20Z
Originally Posted by: Support 

I was thinking about using Notifications and not the Email Task - then you don't need Conditions.



Notifications are labeled as 'Started', 'Complete', and 'Error'. Are you saying that 'Complete' is equal to Success?

I was under the impression that a 'Complete' notification would fire off no matter what, any time the job finishes?

Brian
Support
2012-11-02T15:23:48Z
You are right, I was mixing up future with now 🙂. We will improve Notifications soon so you have On success as well.

Right know I do not know of any good solution for what you want to achieve. One, not so nice way, would be to write the result (of all Tasks) in a Variable Condition and then look if it contains "Failure" or something like that.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2012-11-02T15:42:03Z
Originally Posted by: Support 

You are right, I was mixing up future with now 🙂. We will improve Notifications soon so you have On success as well.

Right know I do not know of any good solution for what you want to achieve. One, not so nice way, would be to write the result (of all Tasks) in a Variable Condition and then look if it contains "Failure" or something like that.



Ok, now I feel better. I wasn't missing anything obvious 🙂 I realize you have alot of things in your head regarding what's current and what is 'coming soon to a VisualCron near you', would be very difficult to keep straigiht.

I just want to make sure that if the Success notification feature is added in a future release, that the Job status actually has a valid result.

So, if in my case, one of the 5 tasks fails, I want the overall job status to say 'Failure Occurred' or something other than 0 so the success notification would be accurate. OR, have each task have the ability to still continue on to the next task, but have a checkbox to trip the overall Job Result as 'failed'.

Make sense?

Brian
Scroll to Top