How do I design a workflow to monitor itself for long running session tasks?
I have tried using timers to send out emails after an hour, but then the workflow runs for as long as the timer (1 hr) even if the session runs successfully in 10 minutes, and the email is always sent anyway.
I have tried using a worklet that uses two execution paths. One path contains a Timer Task and a Email Task to test for and notifiy on a long running session. The other path has an Event Wait File Watch Task and a Control Task that look for a "successful run" flag file (created by the session when it completes successfully) and then stop the worklet if it is seen (stopping the timer execution path also). However, this method doesn't work either because when the worklet is stopped the parent workflow is also stopped and it doesn't reschedule.
Are there any ideas on how to have workflow monitor itself, or the sessions if contains, to make sure they are not taking longer than expected? I would like this to be able to be self contained to a specific workflow as we have external programs the monitor for long running workflows/sessions generall (see below). Any help/ideas would be GREATLY appreciated.
Why I want to monitor for long running sessions:
We have an issue where a workflow that runs daily contains a session that hangs randomly. When the session hangs it simply creates a 308 byte log (that can not be viewed with the log viewer) and then sits idle until we manually intervine with the session and parent workflow. To correct the problem we have to manually kill the session at the OS level, delete the session log file, and then kick off the workflow containing the session again.
How we currently deal with the problem:
I have an external java program that kicks off hourly from CRON and uses the Powercenter command tools to query the Domain for long running processes in a very general form. If there are any long running processes a notification email is sent out to be manually read, reviewed and interacted with. But again this is all general to our entire environment and not specific to the workflow in question.