How to cancel a workflow and kill all tasks/stop new tasks from launching
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2013 10:53 AM
I have a couple of custom changes (new server addition) which fire off tasks as other ones complete, and automatically closes when all tasks are completed.
To facilitate this process, I lock down the "State" field so that the people who own the changes can't close them prematurely before the tasks complete. I want it to be automated.
However, sometimes, after approvals, they want to cancel the change. Since I'm an admin, I can go in and close it, but then it auto-closes the first task and launches the next ones.
I need to add a UI Action button or something for the owners of changes to click "Cancel Change" that will close it out and close out any Change Tasks but also not launch the next tasks in the workflow.
What can I do to accomplish this?
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2013 12:08 PM
There's a Script Include that you need to call. If you go check out the Script Include called "Workflow", you'll find your answer. There is a function within that you can call to cancel the workflow for the Change. Typically, any of the Closed states that trigger Active = false will trigger this Script Include to be called. Your UI Action will have to utilize a GlideRecord object to make sure the change tasks are also closed appropriately.
See where this gets you in your work for a solution and let me know if you need more nudges.