如何在主机应用程序代码中访问公共工作流属性?

发布于 2024-07-15 00:21:37 字数 358 浏览 4 评论 0原文

我有一个工作流程,它有一个公共“状态”属性,该属性返回一个存储有关工作流程的数据的自定义类(它在工作流程执行期间发生变化)。

在工作流主机(本例中为 ASP.NET 应用程序)的代码中,在任何时候获取该属性的值的最佳模式/实践是什么?

我研究了 CallExternalMethodActivity,但我排除了它,因为在我的情况下,我需要某种“按需”模型,在其中我可以请求我的工作流程在执行的任何时间点为我提供其属性的值。

我还研究了跟踪服务,但由于我并不真正关心跟踪任何事件,因此似乎整个跟踪模型存在开销,而且当数据已经是跟踪存储的一部分时,将数据保存到跟踪存储也存在口是心非的情况。工作流程。

有什么建议/代码示例吗?

I have a workflow that has a public "State" property that returns a custom class storing data about the workflow (it changes during the execution of the workflow).

What is the best pattern/practice to get the value of that property while in the code of the workflow host (ASP.NET app in this case) at any point?

I looked into the CallExternalMethodActivity, but I ruled it out since in my case I need to have some kind of "on demand" model, where I can request my workflow to give me the value of it's property at any point of time of it's execution.

I also looked into tracking services, but since I don't really care about tracking any events, it seems like there is an overhead of the whole tracking model and also duplicity of saving the data to the tracking store while it is already part of the workflow.

Any suggestions/code examples?

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

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

发布评论

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

评论(1

书间行客 2024-07-22 00:21:37

马特·米尔纳 (Matt Milner) 有一篇非常好的文章 带有工作样本。 他使用的是自定义跟踪服务来为您完成这项工作,因此您无需弄乱跟踪配置文件等。

请确保您还阅读了文章用户评论,因为它们包含有关持久工作流程的一些重要信息。

Matt Milner has got a pretty good article with a working sample. He's using a custom tracking service that does the job for you, so you don't need to mess with tracking profiles and the like.

Make sure you also read the article user comments, as they contain some important information about persisted workflows.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文