如何在单个工作流服务 (WF4) 中定义多个接收活动

发布于 2024-08-23 07:43:28 字数 377 浏览 5 评论 0原文

我有一个工作流服务(在 .xamlx 文件中声明性定义),当前包含一个 Recieve 活动。您可能知道,服务通常会公开多个操作。 这也是我希望通过我的服务实现的目标。如何向此服务添加更多操作?没有WF,这真的很容易。只需添加任意数量的方法并用 OperationContract 装饰它们即可。然后客户端可以调用服务提供的任何操作。另一方面,在 WF4 中,当我尝试向服务添加另一个接收活动时,我只能将其添加到现有活动之前或之后。我想我可以使用 Pick 活动来完成此任务,但我只是猜测。我就是这样做的吗?或者我应该添加另一个工作流服务并向其中添加接收活动? (听起来根本不是一个好的解决方案)。或者也许有正确的方法来实现这一目标?

聚苯乙烯 如您所知,我对 WF 完全陌生,尤其是 WF4。

谢谢, 阿维

I have a workflow service (defined declaretively in a .xamlx file) that currently contains one Recieve activity. As you may know, services usually expose more than one operation.
And that's what I would like to do with my service too. How do I add more operations to this service? Without WF, that's really easy. Just add as many methods as you wish and decorate them with OperationContract. Then the client can call any of the operations that service offers. In WF4, on the other hand, when I try to add another Recieve activity to the service, I can only add it either before or after an existing activiy. I thought I might use the Pick activity to accomplish this, but I'm just guessing. Is this how I do it? Or should I add another workflow service and add the Receive activity to it? (doesn't sound like a good solution at all). Or perhaps there is a right way to accomplish this?

P.S
As you can tell, I'm totally new to WF in general, and WF4 in particular.

Thanks,
Avi

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

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

发布评论

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

评论(1

℉絮湮 2024-08-30 07:43:31

在工作流开始时具有单个接收活动并不罕见,毕竟通常有一个启动工作流的事件。一旦启动,它就可以等待其他消息到达。但是,没有理由不让工作流程同时侦听多个不同的活动,正如您所提到的,选择活动是正确的选择。只需在设计界面上放置一个 Pick,然后添加任意数量的 PickBrache 和 Receive 活动,就可以开始了。

Having a single Receive activity at the start of a workflow is not uncommon, after all there is usually a single event that starts a workflow. And once started it can wait for other messages to arrive. However there is no reason not to have a workflow listen for multiple different at the same time and, as you mentioned, a Pick activity is the way to go. Just drop a Pick on the design surface, add as many PickBrache with Receive activities as you like and you are good to go.

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