0

我正在 VS 2010 中编写 SP 2010 自定义工作流。在处理此处找到的示例时 ( http://msdn.microsoft.com/en-us/library/hh824675(v=office.14).aspx )。我遇到了 OnTaskCreated ( http://support.microsoft.com/kb/970548 ) 的错误......即使帖子是 SP Services 3.0,SP 2010 的错误似乎仍然存在。解决方法是创建Visual Studio 中一个很好的 'ol 事件接收器;现在一切都很好。

这让我想到,也许我应该首先使用事件接收器来构建整个东西!我错过了什么?SharePoint 的 VS 工作流提供了 VS 事件接收器所缺乏的什么?

4

1 回答 1

3

Event receivers lack state. A workflow doesn't just fire once. It is stared, has some events that are fired, but they represent a sequence of actions that are all fired and that act on some state specific to the lifetime of the whole workflow. With event receivers there is no state. If you want a series of event receivers to logically represent a stateful workflow you need to explicitly create a list or other external storage medium that can represent that state.

(Note this is the most important conceptual difference; obviously there are any number of lower level differences on an implementation, rather than conceptual, level.)

于 2013-09-06T19:52:37.743 回答