以编程方式更新列表项时工作流程停止响应
我有一个工作流程在列表中的项目上运行。 该工作流在 While 活动中包含 OnWorkflowItemChanged 活动。 我知道工作流进入 While 循环,如果我通过 UI 更新项目,它会触发 OnWorkflowItemChanged 活动。 但是,如果我以编程方式(通过控制台应用程序)更新项目,它不仅不会触发 OnWorkflowItemChanged 活动,而且还会停止通过 UI 响应更新。
有没有人见过这个? 有没有一种方法可以以编程方式更新列表项,并使工作流既响应事件又继续响应未来的事件?
编辑:如果我使用列表 Web 服务来更新项目,效果很好。 如果我使用对象模型,为什么会出现混乱?
I have a workflow running on an item in a list. The workflow has an OnWorkflowItemChanged activity sitting within a While activity. I know that the workflow enters the While loop, and if I update the item through the UI, it fires the OnWorkflowItemChanged activity. However, if I update the item programmatically (through a console application), it not only does NOT fire the OnWorkflowItemChanged activity, but it stops responding to updates through the UI as well.
Has anyone seen this before? Is there a way to update the list item programmatically and have the workflow both respond to the event and continue responding to future events?
edit: It works fine if I use the Lists web service to update the item. Why does it mess up if I use the object model?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我知道当通过事件接收器中的对象模型更新列表项时,您可以调用 SPEventReceiverBase.DisableEventFiring() 等。 SPEventReceiverBase.DisableEventFiring() 您尝试过吗,或者是否有等效的工作流程?
这里有一个技巧,可以禁用事件接收器内部未触发的更新的事件触发: 链接文本
I know when updating a list item through the object model in an event receiver you can call SPEventReceiverBase.DisableEventFiring(), etc. SPEventReceiverBase.DisableEventFiring() Have you tried that, or is there a workflow equivalent?
Here's a hack to disable event firing on updates that aren't triggered from inside an event receiver: link text
是的,我同意问题是事件根本没有触发。 我注意到,如果您重置 IIS,它第一次可以工作,但之后就没有更新了。
Yup i agree the problem is that event is not at all firing. I have noticed that if you reset IIS it works for the first time but after that there is no update.
看起来引发事件的唯一方法是使用列表 Web 服务。
It looks like the only way to make the events fire is to use the Lists Web Service.