This UDA can be used to terminate the old instance of a workflow that may be running on a particular list item.
|Long Description||Did you know that if you are running an instance of "WorkflowA" on an item, and you then go and make a change to the workflow, republish it, you will now be able to run another instance of "WorkflowA" on that item? This UDA helps to eliminate any old instances running on that item.|
|Support Info||Vadim Tabakman - Nintex Workflow - Terminate Previous Instances of a Workflow - Vadim Tabakman|
Nintex Workflow 2007
Nintex Workflow 2010
Nintex Workflow 2013
SharePoint Server 2007
SharePoint Server 2010
SharePoint Server 2013
Basically what it does is :
1. store the current workflow instance ID in a text variable (this is the current workflow and we don't want to touch it).
2. make a call to the Nintex Workflow web service to find out what running instances of this workflow there are on the current item
3. remove the XML namespace from the xml returned to us from the web service call.
4. query the xml to pull out only the Workflow Instance IDs.
5. iterate through each ID.
6. if the ID matches the current workflow instance ID, leave it alone.
7. if it doesn't match, it's an old version, and we need to terminate it.
8. make a web service call to the Nintex Workflow web service to terminate the instance of the workflow that matches the ID we are looking at.
Find out more or view other comments here Nintex Workflow - Terminate Previous Instances of a Workflow - Vadim Tabakman