单线程单元中的工作流程 4.0?
我现在正在努力研究 WF 4.0,但我很难弄清楚如何在 STA 线程中运行工作流程。我需要在工作流程中构建 XPS 文档,这意味着我需要创建 UI 元素 (FixedPage),这意味着运行工作流程的线程必须是 STA。
在 3.0 中,您可以使用 ManualWorkflowSchedulerService 执行一些魔法(我没有管理这部分代码,因此这里没有详细信息),以使工作流在 STA 线程中运行。但现在 4.0 已经不同了;即使 beta 2 也与 beta 1 不同...
有人知道如何让 4.0 工作流程在 STA 线程中运行吗?
我无法使用 WorkflowInvoker,因为它仅适用于不需要持久性的短期工作流,而我需要持久性。
I'm looking hard at WF 4.0 right now, but I'm having a hard time figuring out how to run workflows in STA threads. I've got a requirement for constructing XPS documents in a workflow, which means I need to create UI elements (FixedPage), which means the thread running the workflow has to be STA.
In 3.0, you could do some magic (I didn't manage this part of the code, so no details here) with the ManualWorkflowSchedulerService to get the workflow running in a STA thread. But now 4.0 is much different; even beta 2 is different from beta 1...
Anybody know how to get 4.0 workflows running in STA threads?
I can't use the WorkflowInvoker because it is only for short-lived workflows that don't require persistence, which I do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尝试过使用 WorkflowInvoker 吗?这应该只在原始线程上执行工作流,而不是在后台线程上安排工作。
Have you tried using the WorkflowInvoker? This should just execute the workflow on the original thread and not schedule work on a background tread.