是否可以将工作流参数与 WorkflowServiceHost 托管的工作流一起使用?

发布于 2024-07-09 11:59:08 字数 180 浏览 4 评论 0原文

通常,将工作流参数传递给工作流的方法发生在对 RunWorkflow 的调用中。 但是,对于 WorkflowServiceHost,不涉及此类方法调用。 您只需在实例上调用 Open() 方法即可。 有任何想法吗?

当然,这意味着我向服务契约添加了更多参数,但这些参数与服务的消费者无关。 它们更像是配置值。

Normally, the method of passing workflow parameters to the workflow happens in the call to RunWorkflow. However, with the WorkflowServiceHost, there is no such method call involved. You simply call the Open() method on the instance. Any ideas?

Of course, the implication is that I add more parameters to the service contract, but these parameters are not relevant for the consumers of the service. They are more like configuration values.

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

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

发布评论

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

评论(2

倒带 2024-07-16 11:59:08

我相信 WorkflowServiceHost 是为您包装的 WorkflowRuntime 的重新托管,而不是真正与它关联的参数的活动。 通常,您定义将与 ReceiveActivity 一起使用的数据协定,并且该协定的数据成员代表您将在工作流中使用的参数。

I believe the WorkflowServiceHost is a re-hosting of the WorkflowRuntime that has been wrapped for you and not really an activity that would parameters associated with it. Typically, you define your data contract that you are going to use with your ReceiveActivity and the data members of that contract represent the parameters you are going to use within the workflow.

难以启齿的温柔 2024-07-16 11:59:08

到目前为止,我已经确定在某些情况下这是可能的。 如果工作流是由主机启动的,则可以传递参数。 但是,如果 ReceiveActivity 导致创建工作流(CanCreateInstance 设置为 True),则您似乎不能这样做。

So far, I've determined it is possible under some circumstances. If the workflow is started by the host, parameters can be passed. However, if a ReceiveActivity causes the workflow to be created (CanCreateInstance is set to True), then it appears that you cannot.

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