Restart a workflow context without affecting other workflows running on the record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2013 02:53 AM
Hello there,
I have a requirement to selectively restart a workflow context associated to an Incident record. This can be done by either restarting the workflow context or even by deleting & creating the workflow again.
I can see from wiki and forums about methods such as restartWorkflow(), deleteWorkflow() which acts on all workflows associated to that incident record. However, there are few other workflows (unrelated to the workflow version being restarted) on this record, which should not be affected by this restart.
Can anyone please guide me on the ways to restart a workflow context without affecting other workflows?
Regards,
Praveen
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2016 01:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2016 09:40 AM
My code there was really old; but regardless, there may be an issue with the app reading the WF Transition history.
Of course, it's always better to use the OOB-provided methods to restart a workflow. In your case, it should work because it appears you only have one WF running, and no approvals.
You should be able to use this:
new Workflow().restartWorkflow(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2017 07:00 AM
Hey Valor,
We're trying to get this code to run but it doesn't appear to be working for us. Any clarification on the following block of code? I can't find any documentation on it.
wf._deleteExecutingActivities(gr.sys_id + '');
wf._updateHistoryActivities(gr.sys_id + '');
wf._createBeginActivity(gr);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2017 10:24 AM
My code is really old and is using undocumented, private methods.
I pilled those "_" methods out of the "Workflow" Script Include. As they're private, you'll not find any official documentation on it.
What at version are you running?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2017 10:26 AM
Yeah I noticed the date and was worried it might not work for us. We're running on Helsinki. I'll check out that script include and see if it explains why this isn't operating.
EDIT: I should have looked before replying it seems like the functions you're calling are not in the Workflow Script include. I'm going to assume they were stripped in later versions. Any suggestions to update this code for Helsinki?