- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 09:21 AM
In the workflow of a service catalog request I've added an approval step. I've been asked to have the request automatically cancel itself if the approval step is not completed within X days of time. How would I implement that?
I would *prefer* not to have a daily scheduled job that checks, but rather have it all inside the workflow itself if possible.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 09:31 AM
Hi Scott,
You need to add a timer activity.Send output of a activity to both approval and timer at a time.After the timer activity add a if activity that will check the approval activity is completed or not.If it is not completed then set value to cancel request.
Please mark it as Helpful/Correct according to its impact,
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 09:30 AM
You could put a timer function at the same time as the approval activity in your workflow and when it completes, it checks if the approval has been set to approved. If not, it sets the request to cancelled. You just couldn't use a join. The issue would be no consistency of all activities being completed before the workflow ends.
branch --> timer activity
---> if not approved --> cancel
--> approval activity --> continue --> complete
The other would be to use a scheduled job or a condition checker which isn't that difficult. With a condition checker, you could set an expiry field so there are warnings that it will be cancelled soon. It's easy to report on too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 09:37 AM
The condition checker with warnings sounds interesting. Can you point me at details on that please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 10:18 AM
Here is a link of details: Define a condition check
Basically you create condition checks as required with a set of rules. You add a condition check reference field onto your form. The condition checker runs once per day and updates those fields according to the rules you've assigned. It will only set that condition once so if you have one set up to say "Expires in 15 days" then it won't set it again until it meets another condition (i.e. "Expired")
You can then set up email notifications to fire off based on that field being set to certain values. We use this to send the warning along with the value of that field so it is always correct (i.e. "Expires within 15 days" in the subject line.) When it is set to expired, you could have a business rule cancel everything.
1. Set up your condition check field on the table (type: reference, reference: Condition)
2. Set up your 1 or many condition check definitions for that table on your condition field. Note: their order should be last condition first and first condition last. So my expired condition is order 25, my expires within 15 days is order 50 and my expires within 30 days is order 100.)
3. Set up your events to fire.
4. Set up your email notifications triggered by your event, depending on what you'd like to be sent out.
5. Set up your business rule to cancel/reject if your expired condition is met.
My example of a condition check on a field I created on the user table to warn managers when a contractor's end date is approaching:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2016 08:55 AM
This looks pretty cool, but those tables are empty in our environment, meaning nobody else has done this, so I think I better stick with the more generic solutions. Otherwise, when I move on to a new role, nobody will know what the heck I did