在 Sharepoint 工作流中使用 ReceiveActivity

发布于 2024-08-24 08:10:52 字数 700 浏览 6 评论 0原文

我已经在 sharepoint 中创建了第一个小工作流程,并且尝试使用 ReceiveActivity 从外部访问它。我创建了一个 WCF svc 文件

并在 IIS 中创建一个网站,其应用程序池与共享点网站相同。

现在我可以从 doclib 启动工作流,但是当我尝试访问如下所示的 ReceiveActivity 时,出现以下错误:“工作流托管环境没有工作流实例上的操作所需的持久性服务”。

我认为这与我自己的 WCF 网站中没有使用 Sharepoint 持久性服务有关,但我不确定。关于这个有什么想法吗???

DoMyThingContractClient proxy = new DoMyThingContractClient ();

IContextManager contextManager = proxy.InnerChannel.GetProperty<IContextManager>();

IDictionary<string, string> context = contextManager.GetContext();
context.Add("instanceId", myInstanceId);
contextManager.SetContext(context);

result = proxy.GetMyMethod(tb1.Text, tb2.Text);

I've made my first little workflow in sharepoint and I am trying to access it from the outside using a ReceiveActivity. I have created a WCF svc file with

and created a website in IIS with the same application pool as the sharepoint site.

Now I can start the workflow from my doclib, but when I try to reach the ReceiveActivity like below, I get the following error: "the workflow hosting environment does not have a persistence service as required by an operation on the workflow instance".

I think it has something to do with not using the Sharepoint persistence service in my own WCF website, but I'm not sure. Any idea's on this one???

DoMyThingContractClient proxy = new DoMyThingContractClient ();

IContextManager contextManager = proxy.InnerChannel.GetProperty<IContextManager>();

IDictionary<string, string> context = contextManager.GetContext();
context.Add("instanceId", myInstanceId);
contextManager.SetContext(context);

result = proxy.GetMyMethod(tb1.Text, tb2.Text);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空心↖ 2024-08-31 08:10:53

您是否创建了托管工作流的 SQL 表?位于 C:\Windows\Microsoft.NET\Framework\v3.0\Windows Workflow Foundation\SQL\en 的?如果您这样做了,您现在需要将所需的标记添加到您的配置(在本例中为包含 svc 文件的 WCF 文件夹),如下所述 位于 msdn

评论后编辑:尝试在代码中运行持久性服务:

SqlWorkflowPersistenceService ps = new SqlWorkflowPersistenceService("Initial Catalog=SqlPersistenceService;Data Source=localhost;Integrated Security=SSPI");
currentWorkflowRuntime.AddService(ps);

Have you created the SQL tables that host the workflows? The ones at C:\Windows\Microsoft.NET\Framework\v3.0\Windows Workflow Foundation\SQL\en? If you did, you now need to add the required tags to your config (your WCF's folder with the svc file in this case) as explained at msdn.

Edit after comments: try to run a Persistance Service in your code:

SqlWorkflowPersistenceService ps = new SqlWorkflowPersistenceService("Initial Catalog=SqlPersistenceService;Data Source=localhost;Integrated Security=SSPI");
currentWorkflowRuntime.AddService(ps);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文