简体   繁体   English

工作流基础-顺序工作流中的多个书签

[英]Workflow Foundation - Multiple Bookmarks in Sequential Workflow

I am having trouble with multiple bookmarks in a WCF Windows Workflow Application. 我在WCF Windows工作流应用程序中无法使用多个书签。

The problem is that I am not able to resume more than one bookmark. 问题是我不能恢复多个书签。 When I attempt to resume the second bookmark the workflow I am receiving a BookmarkResumptionResult of NotFound. 当我尝试恢复第二个书签工作流时,我收到的是NotFound的BookmarkResumptionResult。 If I attempt to resume the bookmark again I get an InstanceLocked Exception. 如果尝试再次恢复书签,则会收到InstanceLocked异常。

It appears that the initial bookmark is still persisted to the Workflow Database. 似乎初始书签仍保留在工作流数据库中。

Furthermore, this issue only appears to happen when I am executing an activity before the resumption of a bookmark. 此外,仅当我在恢复书签之前执行活动时,才会出现此问题。

Stranger still is that I can execute as many activities as I want that do not have an OutArgument. 陌生人仍然是我可以执行没有OutArgument的任意数量的活动。 Once I have an OutArgument or a NativeActivity with a Result it appears that the initial bookmark is still persisted and I cannot continue with my workflow. 一旦有了带有结果的OutArgument或NativeActivity,它似乎仍然保留了初始书签,并且我无法继续进行工作流程。 If I have a simple activity with no Result or OutArgument that writes to the database or does something simple I am able to resume as many bookmarks as I want. 如果我有一个简单的活动,没有可写入数据库或执行简单操作的Result或OutArgument,则可以恢复任意数量的书签。

Below is some information about my environment: 以下是有关我的环境的一些信息:

  1. I am running the workflow as a WCF NT service. 我将工作流作为WCF NT服务运行。
  2. I am using the WorkflowApplication class to manage my workflows 我正在使用WorkflowApplication类来管理我的工作流程
  3. The WorkflowApplication instance is configured as WorkflowApplication实例配置为

    a. 一种。 PersistableIdle event is PersistableIdleAction.Unload PersistableIdle事件为PersistableIdleAction.Unload

    b. Everything else is pretty much bare bones 其他一切几乎都是裸露的骨头

  4. The workflow service behavior WorkflowIdleBehavior has a TimeToUnload of new TimeSpan(0, 0, 0) 工作流服务行为WorkflowIdleBehavior具有新的TimeSpan(0,0,0)的TimeToUnload

I am still fairly new to WWF (as well as posting on SO) and hope I included enough information, please let me know if there are any specifics needed. 我对WWF还是很陌生(以及在SO上发帖),希望我提供了足够的信息,如果需要任何详细信息,请告诉我。

Thank you in advance for your help! 预先感谢您的帮助!

The issue that was occurring was that my activity was returning an Entity Framework model. 发生的问题是我的活动正在返回实体框架模型。

I solved this problem by returning a Data Transfer Object with properties containing the values I needed. 我通过返回一个数据传输对象来解决此问题,该对象的属性包含所需的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM