The computer that runs our tasks - IE print to PDF when a drawing is released - needs to be restarted from time to time for Windows updates, etc. So, I'm trying to setup a query that will run every 30 minutes to verify that print tasks are not backed up.
I can query dbo.TaskInstances for tasks that have not completed (the EndTime would be blank) but have found a glitch in my logic. Any time that my query runs just after a task has started it will find current incomplete tasks that are in process. I really need to find only tasks that have been "stuck" for more than 10 minutes. The TaskInstance table has a StartTime but this field is the start time of when the task host starts working on the task, not when the task was requested by a workflow.
Any idea if there is a time stamp in another table that I can monitor? My logic needs to be to find any task that has been requested but not completed.