Skip to main content
Nintex Community Menu Bar

Hi,

at a customer of us there are duplicate entries in workflow inventory. They use Nintex for SharePoint 2019, 5.2.12.0.

I found out that in the Nintex content database there are rows with an invalid WebApplicationId in the tables dbo.Workflows and dbo.PublishedWorkflows. In fact there is no WebApplication with this ID, and there is only one Nintex content database. As it seems to me, when the customer publishes such a workflow, a new row is created with the correct WebApplicationId. So workflow inventory shows a published version and a version 0.1 of the workflow.

Is it safe to update the WebApplicationId in dbo.Workflows and dbo.PublishedWorkflows and to remove duplicate rows from dbo.Workflows? That way it would try to solve the problem.

Regards, Andreas

Hi ​@ls-avi,

This issue generally occurs when the migration process is not followed.
This KB may be helpful.
 

 


Hi ​@ls-avi has your issue been resolved? 


Thanks, the issue seems to be resolved. Unfortunately we couldn’t move data because there was only one Nintex content database. But we applied the following steps to the database:

 

-- 1. Update the WebApplicationId in dbo.Workflows of workflows that are not duplicate:

update dbo.Workflows 
set WebApplicationId = 'CORRECT ID'
where WorkflowId not in (
    -- finds duplicate entries
    select WorkflowId from dbo.Workflows group by WorkflowId having count(*) > 1
) and WebApplicationId = 'INVALID ID';

 

-- 2. Delete the duplicate entries in dbo.Workflows with an invalid id.
delete from dbo.Workflows where WebApplicationId = 'INVALID ID';

 

-- 3. Update the WebApplicationId in dbo.PublishedWorkflows of workflows that are not duplicate. Some old versions with an invalid WebApplicationId remain, but that doesn’t seem to matter.

with cte_p1 as (
    -- use distinct values because there are multiple version rows
    select distinct WebApplicationId, WorkflowId from dbo.PublishedWorkflows
), cte_p2 as (
    select * from cte_p1 where WorkflowId not in (
        -- finds duplicate entries
        select WorkflowId from cte_p1 group by WorkflowId having count(*) > 1
    ) and WebApplicationId = 'INVALID ID'
)
update pw set
WebApplicationId = 'CORRECT ID'
from dbo.PublishedWorkflows pw 
    inner join cte_p2 p2 on pw.WorkflowId = p2.WorkflowId and pw.WebApplicationId = p2.WebApplicationId;
 

 


Reply