长时间运行的工作流版本控制:在哪里以及如何使用 OnActivityExecutionContextLoad?

发布于 2024-10-18 14:14:11 字数 806 浏览 2 评论 0原文

我们有一个长期运行的工作流程,它使用 SQL 跟踪服务 (.Net WF 4.0)。在下一次更新中,我们希望在工作流程的参数之一中引入公共属性。由于这是重大更改,持久的工作流程在重新加载时会抛出以下错误:

System.Runtime.DurableInstancing.InstancePersistenceCommandException: The execution of the InstancePersistenceCommand named .. LoadWorkflow was interrupted by an error.

InnerException: System.Runtime.Serialization.SerializationException: 'Element' '_x003C_BookmarkName_x003E_k__BackingField' from namespace '...' is not expected. Expecting element '....'

我知道这是一个典型的版本控制问题,我在某些网站上注意到的建议之一是覆盖OnActivityExecutionContextLoad方法并填写缺失值。但我不知道在哪里以及如何做到这一点! OnActivityExecutionContextLoad 在 System.Workflow.ComponentModel.Activity(.Net 3.5?)中声明,而我们拥有的是从 System.Activities.NativeActivity 派生的基于代码的顶级自定义活动em> (接收有问题的参数)。在这个类中可以做一些事情来初始化参数缺少的属性吗?

欢迎所有建议:)

We have a long running workflow which uses SQL tracking service (.Net WF 4.0). In the next update, we would like to introuduce a public property in one of the arguments of the workflow. Since this is breaking change, the persisted workflow inatances throw the following error on re-loading:

System.Runtime.DurableInstancing.InstancePersistenceCommandException: The execution of the InstancePersistenceCommand named .. LoadWorkflow was interrupted by an error.

InnerException: System.Runtime.Serialization.SerializationException: 'Element' '_x003C_BookmarkName_x003E_k__BackingField' from namespace '...' is not expected. Expecting element '....'

I understand this is a typical versioning issue and one of the recommendations I noticed on some of the sites is to override OnActivityExecutionContextLoad method and fill in the missing values. But I am not sure where and how to do this! OnActivityExecutionContextLoad is declared in System.Workflow.ComponentModel.Activity (.Net 3.5?) whereas what we have is a code-based top-level custom activity derived from System.Activities.NativeActivity (which receives the argument in question). Can something be done in this class to initialize the missing property of the argument?

All suggestions are welcome :)

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文