Solved

A case just disappears !

Sometimes , when a User , with several already occurred in different locations, click on the next case some of the process , it is not possible to find him with any User or with admon , but he's in the database .

How to return a case to the process ?

What insert which table or what value to change the case back to a process activity ?

Comments (7)

photo
1

Dear Wilson,

In order to solve it, please give us further information about your environment:

  • Bizagi version
  • Environment of the problem

Looking forward to hearing from you

photo
1

Version 10.7.0.2082

Environment is Development

photo
photo
1

Version 10.7.0.2082

Environment is Development

photo
1

Dear Wilson,

Thanks so much for this information. We need to reproduce this issue in our labs. To do so, please create a backup of your project following this article: http://help.bizagi.com/bpmsuite/en/when_using_sql_server.htm and then upload here: https://bizagi.sharefile.com/r-r1742de9762c4752a.

In addition, tell us the disappeared case and SQL Server version.

Looking forward to hearing from you

photo
1

I think is better a remote acess, can you? Here have a policy to deny send out backup of database with a bussines real data simulation, sorry.

photo
1

Dear Wilson,

A member of our support team will contact you to follow-up this problem.

Regards

photo
photo
1

I managed to solve the issue of the disappearance of the cases

the reason I do not know because, in our tests, we have about 1000 cases and 21 of them disappeared from the process flow were found in the archive, but do not appear in the portal's research or on the screen of any User.

I had to map out what was done by the tool starting database, realized that outside the jobxxxx tables job scheduling, tasks to be performed are in workitem and already performed in workitemcl, I realized that they were out of the process They did not have the records released in workitem.

the script that made the sql was to consult a case, starting the official number of my cases, and see if they contained the records in the tables necessary to be in the process.

Then I created a script to check the last valid record of a case in workitemcl and reinsert it into the workitem.

In the end it is necessary to reassign the case gone to someone via admon panel in the case of research.

So all 21 cases were sunken reinserted the process.

created scripts:

// script to search my case in tables that include case in process workflow

declare @nrDs varchar(50)

declare @idDs int

declare @idCase int

// my case number

set @nrDs = 'DS2015429'

SELECT TOP 100000 [idAtendimentos],[Numero],[Quitado],[DataQuitacao],[TotalEfetivado],[DataValorEfetivado],[ValorACobrarPeloAtendiment],[TotalDeProdutos]

,[TotalDeServicos],[ValorPermanenciaAprovacao],[ValorPermanenciaBuscar],[DataPermanenciaLimiteAprov],[DataPermanenciaLimiteBusca],[TotaldeDescontos]

,[TotalTransporte],[TotalImpostos],[FinanceiroCaixa],[Aprovado],[Faturado],[Ativo],[Concluido],[Cancelado],[Aberto] ,[SituacaoAtual],[SituacaoAtualQuem]

,[SituacaoAtualDesde],[ComentariosInternoDoAtendi] FROM [BPMS_CINV].[dbo].[DS]where Numero in ( @nrDs )

SELECT TOP 1 @idDs=idAtendimentos FROM [BPMS_CINV].[dbo].[DS]where Numero in ( @nrDs )

select top 1 @idCase=idCase from PVBPMS_CINV where DS = @idDs

declare @idJob int

-- set @idDs = 920 -- substituido pelo select acima

--set @idCase = 1239 -- substituido pelo select acima

select * from PVBPMS_CINV where DS = @idDs

select * from JOB where idCase = @idCase

select * from JOBSTEP where idJob = @idJob

select * from WORKITEM where idCase = @idCase order by idWorkItem desc

select * from WORKITEMCL where idCase = @idCase order by idWorkItem desc

select * from WFCASE where radNumber like @nrDs

select * from WFCASECL where radNumber like @nrDs

select * from BASCOPE where idCase = @idCase

/*

Script to reinsert the lost case in process workflow

Objetivo:

.Criar um registro em woritem apartir do workitemcl, sendo o ultima atividade valida do processo que foi fechada

.Reatribuir a tarefa criada ao usuario mais apropriado a executa-la

*/

// detect the losts cases

declare @tbCasesSumidos table( idCaseSumido int, nr int)

insert into @tbCasesSumidos (idCaseSumido,nr)

select x.idCase, ROW_NUMBER() OVER(Order by idCase) from WFCASE as x where x.idCase not in (select z.idCase from WORKITEM as z) order by radNumber

select * from @tbCasesSumidos

// temp table to test data before is included

declare @tbl table

(

idWorkItem int not null,

idCase int,

idTask int,

idWorkItemState int,

wiEntryDate datetime,

wiDuration int,

wiEstimatedSolutionDate datetime,

idParentWorkItem int,

wiSubProcMICurrCount int,

wiSubProcMICountToWaitFor int,

idDeferredByWorkItem int,

wiExtDuration int,

wiExtEstimatedSolutionDate datetime,

wiClosed tinyint,

wiSolutionDate datetime,

idWorkItemScope int,

wiMultiInstanceEnded bit,

wiParentMIId int,

guidWorkitem uniqueidentifier

)

--BEGIN TRANSACTION

declare @id int

declare @x int

declare @qtSumidos int

set @x=0

select @qtSumidos=count(*) from @tbCasesSumidos

while @x<@qtSumidos --set up loop

begin

set @x=@x+1

-- WITH (UPDLOCK, ROWLOCK)

select @id = ISNULL(max(idWorkItem)+1,1) from WORKITEM

-- use @tbl to test before include in BD and WORKITEM to reinsert the case

INSERT INTO @tbl --WORKITEM -- pra valer e no workitem pra teste e na @tabela

([idWorkItem],[idCase],[idTask],[idWorkItemState],[wiEntryDate],[wiDuration],[wiEstimatedSolutionDate]

,[idParentWorkItem],[wiSubProcMICurrCount],[wiSubProcMICountToWaitFor],[idDeferredByWorkItem],[wiExtDuration]

,[wiExtEstimatedSolutionDate],[wiClosed],[wiSolutionDate],[idWorkItemScope],[wiMultiInstanceEnded],[wiParentMIId]

)--,[guidWorkitem])

select TOP 1 @id

,a.idCase

,a.idTask

,3 --a.idWorkItemState -- ACTIVO

,CASE WHEN a.wiEntryDate IS NULL THEN CONVERT(VARCHAR(26),GETDATE()) ELSE CONVERT(VARCHAR(26), a.wiEntryDate)END

,a.wiDuration

,CASE WHEN a.wiEstimatedSolutionDate IS NULL THEN CONVERT(VARCHAR(26),GETDATE()) ELSE CONVERT(VARCHAR(26), a.wiEstimatedSolutionDate)end

,a.idParentWorkItem

,0 --[wiSubProcMICurrCount]

,0 --[wiSubProcMICountToWaitFor]

,null --[idDeferredByWorkItem]

,0 --[wiExtDuration]

,CASE WHEN a.wiExtEstimatedSolutionDate IS NULL THEN CONVERT(VARCHAR(26),GETDATE()) ELSE CONVERT(VARCHAR(26), a.wiExtEstimatedSolutionDate)end

,a.wiClosed

,CASE WHEN a.wiSolutionDate IS NULL THEN CONVERT(VARCHAR(26),GETDATE()) ELSE CONVERT(VARCHAR(26), a.wiSolutionDate)end

,(select top 1 idScope from BASCOPE where idCase = a.idCase) --[idWorkItemScope]

,a.wiMultiInstanceEnded

,a.wiParentMIId

--,a.guidWorkitem

from WORKITEMCL as a where idCase = (select x.idCaseSumido from @tbCasesSumidos as x where x.nr = @x ) order by idWorkItem desc

end

--COMMIT transaction

select * from @tbl order by idTask