
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2019 05:05 PM
I have a workflow with several Catalog Tasks. These Tasks transition to a Join when they are complete. The Join transitions to a Wait for condition and then an end.
I was wondering, if there is a was to handle situations where someone closes all the tasks initially, but then goes back and sets a task state back to something other than Closed {complete, incomplete, skipped}. (I guess b/c closing was a mistake?)
What I've seen happen, is that the Request Item is set to Closed complete, Inactive, and it doesn't automatically start the workflow from that point again.
Would checking or waiting to check if all tasks are really closed before passing to a Wait for condition and End be an option? It's sort of like a redundant check, that pauses before the final check, in case someone made a mistake and closed all the associated tasks. I think. Or some type of workflow that's tolerant of a "Cancel" state?
Anyone done anything like this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2019 08:37 PM
Well, in this approach, the wait duration is not certain, the task can be cancelled any time after being closed. You could add a fixed wait duration to make your workflow but that won't work if the task gets cancelled after the time has passed.
One way to do what you want is having an after update business rule in Catalog Task table for that specific Catalog Item, with a condition to trigger only when the Task state changes from "Closed Complete" to "Cancelled" / "Closed Incomplete". In the business rule, you can have a script to restart the workflow. You can get more information on how to restart a workflow using scripts here:
https://developer.servicenow.com/app.do#!/api_doc?v=madrid&id=r_WF-restartWorkflow_GR_B
E.g.
new WorkflowApprovalUtils().cancelAll(current, comment);
new Workflow().restartWorkflow(current);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2019 06:14 PM
Just a thought, would it be worth restarting the workflow just if one of the tasks was marked as cancelled after being closed? I mean you wouldn't need all the activities (approvals, other independent catalog tasks, notifications etc.) to be done again if just one task was cancelled.
One approach to handle such situations could be having an after update business rule in Catalog Task table, to mark the requested item as Closed Incomplete if the task was initially closed and then later changed to cancelled.
You can have a notification where the task changes from 'Closed Complete' to 'Cancelled' and the requested item from 'Closed Complete' to 'Closed Incomplete', just so that teams / user are aware that which task was cancelled and then they can take required actions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2019 10:08 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2019 08:37 PM
Well, in this approach, the wait duration is not certain, the task can be cancelled any time after being closed. You could add a fixed wait duration to make your workflow but that won't work if the task gets cancelled after the time has passed.
One way to do what you want is having an after update business rule in Catalog Task table for that specific Catalog Item, with a condition to trigger only when the Task state changes from "Closed Complete" to "Cancelled" / "Closed Incomplete". In the business rule, you can have a script to restart the workflow. You can get more information on how to restart a workflow using scripts here:
https://developer.servicenow.com/app.do#!/api_doc?v=madrid&id=r_WF-restartWorkflow_GR_B
E.g.
new WorkflowApprovalUtils().cancelAll(current, comment);
new Workflow().restartWorkflow(current);