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.


Jon
  •  Jon
  • No customer Topic Starter
2008-09-26T23:59:25Z
Is there a way to surface the status of your job as it's running and when it has either completely successfully, or unsuccessfully?
thanks
Sponsor
Forum information
Support
2008-09-27T11:38:15Z
You can use the OnJobUpdated event and check for Job.Stats.ExitCode. If other than 0 then it has failed.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Jon
  •  Jon
  • No customer Topic Starter
2009-07-23T01:41:53Z
Can you provide a code snippet on how to do this? Thanks.
Support
2009-07-26T17:40:45Z
There are two ways:

            server.Processes.TaskProcessEnded += new Processes.DelegateTaskProcessEnded(Processes_TaskProcessEnded);
        }

        void Processes_TaskProcessEnded(ref Server server, VCTaskProcessClass pc)
        {
            TaskClass tc = s.Jobs.Tasks.Get(pc.TaskId);
            Console.WriteLine(tc.Stats.Result);
        }


or

            server.Jobs.Tasks.TaskUpdated += new Tasks.DelegateOnTaskUpdated(Tasks_TaskUpdated);
        }

        void Tasks_TaskUpdated(ref Server server, JobClass j, TaskClass t)
        {
            Console.WriteLine(t.Stats.Result);
        }


Try them out t see which fits best for you.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top