Approach to send an Email Notification when a Job runs for a Long time:
Description: Here is an approach to send an Email Notification if a desired task is running for a long time or exceeding a stipulated time. This approach doesnot send an email notification when the desired task runs normally or within the stipulated time.
Approach: This approach enables to send an email notification if a Task is running for more than a stipulated time [or say 20 mins] . Here in the below scenario consider the EventWait task to check its run time. Create a Work flow variable $$GO_SIGNAL_FOR_EMAIL with nstring as [Link] the default value of this variable to a character N and validate it. Create an Assignment task next to the Task for whose delay a notification has to be sent . Link the Assingment task to the parent task using a link [Link] the Assignment task connect to the rest of the tasks in the workflow. Now assign the workflow variable $$GO_SIGNAL_FOR_EMAIL inside the assignment task with a character Y. Now connect a Timer task to the Start task as shown below or to the Task for whose delay a notification is to be sent . Now set the Timer task with the time it has to wait for to send a notification as below:
Connect an Email task to the Timer task using a link [Link] the link task which is in between the timer and email tasks define a condition as: $[Link]=SUCCEEDED AND $$GO_SIGNAL_FOR_EMAIL != Y . Validate it and after whole Work Flow is completed save and proceed for running it.
Advantages: Does not impact the rest of the workflow. Sends an email notification only when the desired Task is running for more than the stipulated time.
Limitations: The overall status of the Work Flow is shown as Running until the Timer task is SUCCEEDED. *Note: Even the Timer task is succeeded the approach only sends an Email Notification when it the desired task exceeds the stipulated time set.
Author: Nagarjuna Reddy Kumbum | Version [Link]