修改了企业编码导致修改前提交的工作流无法审批(报GetConnection String异常)的解决方案

by 吕洪雨 2013.2.22 16:55

注:脚本执行有风险,对于客户正式环境请在研发指导下执行。

产生该问题的原因是因为WF引擎会启动自己的线程来执行任务,这些线程无法获取正确的上下文,因此将上下文存入数据库中以便在WF自己的线程执行操作时可以恢复线程上下文,当企业编码修改后,从数据库恢复的上下文对应的企业忆经不存在了,所以会报GetConnection String异常。通过以下脚本解决

update CS_Workflow_FlowInstance set StartUserContext=replace(StartUserContext,'<EnterpriseID>旧企业编码</EnterpriseID>','<EnterpriseID>新企业编码</EnterpriseID>')
--where State=0

update CS_Workflow_FlowInstance set StartUserContext=replace(StartUserContext,'<EnterpriseName>旧企业名称</EnterpriseName>','<EnterpriseName>新企业名称</EnterpriseName>')
--where State=0

update CS_Workflow_FlowContext set Context=replace(Context,'<EnterpriseID>旧企业编码</EnterpriseID>','<EnterpriseID>新企业编码</EnterpriseID>')
--from CS_Workflow_FlowContext a inner join CS_Workflow_FlowInstance b on a.ID=b.FlowContext and b.State=0

update CS_Workflow_FlowContext set Context=replace(Context,'<EnterpriseName>旧企业名称</EnterpriseName>','<EnterpriseName>新企业名称</EnterpriseName>')
--from CS_Workflow_FlowContext a inner join CS_Workflow_FlowInstance b on a.ID=b.FlowContext and b.State=0

update CS_Workflow_ProcessTrack set DoContext=replace(DoContext,'<EnterpriseID>旧企业编码</EnterpriseID>','<EnterpriseID>新企业编码</EnterpriseID>')
--where TackState=0 or TackState=1

update CS_Workflow_ProcessTrack set DoContext=replace(DoContext,'<EnterpriseName>旧企业名称</EnterpriseName>','<EnterpriseName>新企业名称</EnterpriseName>')
--where TackState=0 or TackState=1

--update CS_Workflow_FlowContext set Context=replace(Context,'<EnterpriseID>旧企业编码</EnterpriseID>','<EnterpriseID>新企业编码</EnterpriseID>')
--from CS_Workflow_FlowContext a inner join CS_Workflow_ProcessTrack b on a.ID=b.FlowContext and (b.TackState=0 or b.TackState=1)

--update CS_Workflow_FlowContext set Context=replace(Context,'<EnterpriseName>旧企业名称</EnterpriseName>','<EnterpriseName>新企业名称</EnterpriseName>')
--from CS_Workflow_FlowContext a inner join CS_Workflow_ProcessTrack b on a.ID=b.FlowContext and (b.TackState=0 or b.TackState=1)

Tags:

评论 (7) -

wangl wrote at 2014/2/27 11:04:00 #

update CS_Workflow_FlowInstance set StartUserContext=replace(StartUserContext,'<EnterpriseID>旧企业编码</EnterpriseID>','<EnterpriseID>新企业编码</EnterpriseID>')
update CS_Workflow_FlowInstance set StartUserContext=replace(StartUserContext,'<EnterpriseName>旧企业名称</EnterpriseName>','<EnterpriseName>新企业名称</EnterpriseName>')
update CS_Workflow_FlowContext set Context=replace(Context,'<EnterpriseID>旧企业编码</EnterpriseID>','<EnterpriseID>新企业编码</EnterpriseID>')
update CS_Workflow_FlowContext set Context=replace(Context,'<EnterpriseName>旧企业名称</EnterpriseName>','<EnterpriseName>新企业名称</EnterpriseName>')
update CS_Workflow_ProcessTrack set DoContext=replace(DoContext,'<EnterpriseID>旧企业编码</EnterpriseID>','<EnterpriseID>新企业编码</EnterpriseID>')
update CS_Workflow_ProcessTrack set DoContext=replace(DoContext,'<EnterpriseName>旧企业名称</EnterpriseName>','<EnterpriseName>新企业名称</EnterpriseName>')

thay mat kinh iphone 6 美国 wrote at 2017/1/19 17:57:42 #

I don't know whether it's just me or if everybody else encountering issues with your blog. It seems like some of the text in your posts are running off the screen. Can someone else please provide feedback and let me know if this is happening to them too? This may be a issue with my web browser because I've had this happen before. Thanks

thay mat kinh iphone 6 美国 wrote at 2017/1/21 9:19:13 #

It's impressive that you are getting thoughts from this article as well as from our dialogue made at this time.

thay mat kinh iphone 6 美国 wrote at 2017/2/6 8:45:22 #

I have read so many content concerning the blogger lovers however this article is genuinely a pleasant piece of writing, keep it up.

thay mat kinh iphone 6 美国 wrote at 2017/2/7 3:20:27 #

When I initially commented I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I receive four emails with the same comment. Is there a way you can remove me from that service? Kudos!

thay mat kinh iphone 6 美国 wrote at 2017/2/15 4:41:06 #

Hello exceptional website! Does running a blog like this require a lot of work? I've very little understanding of coding however I was hoping to start my own blog soon. Anyways, should you have any suggestions or techniques for new blog owners please share. I understand this is off subject nevertheless I just wanted to ask. Kudos!

smoke 美国 wrote at 2017/4/26 18:35:12 #

This is a topic that's near to my heart... Cheers! Where are your contact details though?

添加评论



biuquote
微笑得意调皮害羞酷大笑惊讶发呆喜欢可怜尴尬闭嘴噘嘴皱眉伤心抓狂呕吐坏笑漫骂发怒
Loading


RecentComments

评论 RSS

Statistics

989 篇文章
0 个单页
653567 条评论
11 次评分
233896 次访问
访问统计开始于 2019年12月15日
平均日访问 5439 次
当前 97 人在线