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-23-2013 01:20 PM
Thanks for the code posting. It's working well for me.
I did run into an interesting issue when testing this - one of the steps in the workflow that I'm restarting is an approval activity. I had thought that each time through the workflow, a new approval would be created. Instead, the same approval is reset back to "requested" on each run-through of the workflow.
I'm exploring options but, in the meantime, this code really helped. Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2013 03:08 PM
Look at the WorkflowApprovalUtils.
Something like:
new WorkflowApprovalUtils().reset(current, "Resetting approval based on workflow restart");