How to generate email notifications based on waiting for approval time in workflow?

Todd O
Tera Guru

I want to create a basic workflow that follows this pattern...

1. User submits CR.

2. CR qualifies to enter workflow process. (I have no problems so far through this step)

3. Workflow process sends email to manager group asking for approval. (this steps seems straight forward as well although I cannot test true emails on my dev instance! ugh )

4. If manager does NOT respond in 2 business hours, workflow sends reminder email to manager group. (this is where I start having trouble)

4. If manager does NOT respond in 6 business hours, workflow sends reminder email to directory group. (more trouble here...)

5. Once manager approves/rejects, no more notifications occur and workflow continues on subsequent paths. (I'm in big trouble already)

The trouble I'm having is how to correctly set this up in the workflow designer.   I've tried a few things but none of them seem to make sense.

For example, I tried this: Begin-->Notification Activity (to send email)-->Wait for Condition (include custom script that says either 2 hours passed or Approval has been changed to Rejected/Approved).   This is where I'm getting tripped up. Do I create a script within the Wait Condition or is there an out of the box solution that is a better fit for this? Is there an example available that is similar to what I'm trying to do?

Also, is there an easy way to calculate "business hours" based on the submission time of the CR? Thank you very much in advance for any assistance.

Todd

1 ACCEPTED SOLUTION

conmic
Mega Guru

I was also thinking about a scheduled script that queries the "sys_approval" table for records matching your conditions. This may however complicate maintenance of the process if not properly documented.



As you're conditions are simple and straight forward I think you can integrate it on the workflow by simply checking the field that contains the state of the approval on your record. Something like this:


ApprovalNotification_Capture.PNG


View solution in original post

9 REPLIES 9

fei2
Giga Contributor

If you use "Wait for Condition", you will need a business rule to trigger it again when condition meet.


fei,


Using a "wait for condition" doesn't seem to be a good fit because the workflow goes to the "Approval - Group" box and waits there until the CR is approved or rejected. I'm not able to indicate in the work flow that I want the flow to also go to a "wait for condition" at the same time.  



In reading other posts, it sounds like using "Email Notificatins" is what I want but selecting the proper way in which this gets triggered is not yet clear to me.   For example, "events" are not supposed to be used for "schedule - driven" conditions.  



I am hoping someone knows the best practice for simply sending reminder emails for CR approvals when the approvers doe nothing within a given time frame (e.g., 4 2 hours).   I then want to send another email if they still do nothing after another 2 hours and escalate this time to their manager.   What is the best practice for this? There has to be some SN guru that knows this. Thanks.


Todd


I have never tried this,But can we not use a scheduled script on sys_approval table ?


Yes, this is the path I'm trying now. I just need to figure out the correct script to do the query. It would be helpful if SN had a debugger so you could step line by line through the code. It seems there is only the JavaScript debugger on the client. That doesn't help for server side code that I want to step through.   Instead, I have to write the code, run it, and hope for results as I review them.