I have deleted (even from recycle bin) the list or items, which had approval tasks. Now those task are either hanging on Nintex mobile, or is showing on Nintex web part report.as running instance.
So far i have:
NWAdmin.exe –o PurgeHistoryListData -siteUrl http://yoursite.com/ -lastActivityBefore 2014-07-01 00:00 -state SELECT STATE
NWAdmin.exe -o PurgeWorkflowData -state All -url http://yoursite.com -lastActivityBeforeLocal 2014-07-01T00:00:00 -state SELECT STATE
DECLARE @return_value int
EXEC @return_value = [dbo].[PurgeWorkflowData]
@SiteID='YOUR SITE COLLECTION GUID', --Update to your Site Collection ID
@LastActivityDate = '2014-07-01' --Setting lastworkflowactivity time, this is actions executed older than the date specified
SELECT 'Return Value' = @return_value
Is there any other solution that i am missing?
Tomasz Poszytek The solution that nintex gave me was to expand nintex database, find dbo.WorkflowInstance table, right click and select top 1000 rows, scroll to the bottom of the result and copy/note the site id, go to SharePoint ca server, find your problematic site id using power shell, match both site id's, if does not match we can assume that the site has been deleted/moved, enter: NWAdmin.exe -o PurgeWorkflowData -deletedSites and confirm with yes. It kinda of solved some of the hanging task problems.
Below removed tasks if list/ list item was deleted prior to task completion.
## -url = use subsite to cancel tasks if workflow is created in subsite else use site collection if workflow created in site collection.
NWAdmin.exe -o SyncTerminatedWorkflows -url http://portal.mockcompany.com/sites/department/hr -terminateDeletedItems
Hope this helps someone!
It may I am not sure. Initially you would run this command if the lis item has been deleted prior to completing the workflow task, which in return will sync the tasks that are assigned to users and not show tasks for items that are already deleted.