在持久化状态问题中找不到工作流持久性! [英] Workflow Persistence not found in Persisted State Issue !!

查看:61
本文介绍了在持久化状态问题中找不到工作流持久性!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dear All,

我在.net 2.0 c#Windows应用程序中使用SqlWorkflowPersistence服务,流程是:

I am using SqlWorkflowPersistence service in my .net 2.0 c# windows applicaiton , the flow is:

1.用户提交事件-工作区已启动并保存.

1. User Submits a incident - The worklow is started and saved.

2.经理批准该事件.

2. Manager Approves that Incident. 

现在,在批准事件时,将发生3个DB操作,并且这些操作中是否存在任何问题(通常是由于SQL超时) 工作流实例已从"InstanceState"表中删除.

Now while Approving the Incident there are 3 DB operations that happen and if there is any issue in these operations (usually because of SQL timeouts)  the workflow instance is deleted from table 'InstanceState'.

为了解决这个问题,我们将事件移回初始阶段,并要求用户再次提交并批准!.因为一旦经理在批准时遇到错误,此后,如果他/她再次尝试批准,他们将收到标准错误工作流程实例ID" 在持久性存储中找到",因为它已被删除.

To fix this we move the Incident back to initial stage and ask the user to Submit and Approve again!. Because once Manager gets an error while approving , after that if he/she tries to Approve again they get the standard error  'workflow instance id not found in persistence store' because its already deleted.

我的问题:

我该如何解决这种情况,尤其是在批准阶段,因为即使提交,也就可以删除它,即使可以删除它,也可以重新创建,因此问题不多.但是在批准阶段,工作流只是恢复并且丢失(删除)我们 无法通过C#代码恢复它.

How do I tackle this scenario , especially while Approve stage because if it's Submit then even if workflow is deleted then it can be newly created so there are not much issues.But in Approve stage that workflow is just resumed and if it's lost (deleted) we are not able to recover it via C# code.

简而言之,当工作流终止时,如何防止Sql数据库中的实例退出.

So in short, How do I prevent  Instance from Sql database when workflow is terminated.

推荐答案

有些进步..

在"WorkflowPersistence"数据库中,我们具有删除实例的SP"InsertInstanceState".我评论了删除实例的代码.

In 'WorkflowPersistence' DB, we have SP 'InsertInstanceState' which deletes the instance. I commented the code which deletes the instance.

到目前为止,通过在应用程序中注入错误,对少数几种情况进行了测试.看起来像它正常工作,但我不确定这是否正确.

Tested for few of scenarios so far by injecting errors in the application. Looks like its working BUT I am not sure if this is correct way.

任何人都可以提供您对这种方法可能引起的任何问题的意见吗?.

Can anyone please provide your inputs of any issues this approach may cause?.

SP的一部分显示在下面,我对其进行了更改.

 Part of the SP is shown below which I changed.

IF

@ status = 1或@ status = 3         
   开始   

@status=1 OR @status=3          
    BEGIN      

/*从[dbo]中删除.[InstanceState] WHERE uidInstanceID = @ uidInstanceID AND(((ownerID = @ownerID AND ownerUntil> = @ now))
  OR(ownerID为NULL和@ownerID为NULL))        
*/
    END 

/* DELETE FROM [dbo].[InstanceState] WHERE uidInstanceID=@uidInstanceID AND ((ownerID = @ownerID AND ownedUntil>=@now) 
 OR (ownerID IS NULL AND @ownerID IS NULL ))          
*/
    END  


这篇关于在持久化状态问题中找不到工作流持久性!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆