工作流服务关联

发布于 2024-12-07 17:08:59 字数 979 浏览 5 评论 0原文

我想实现下一个工作流程场景: 在此处输入图像描述
我有两个分支的工作流服务。操作2(接收活动)与从消息头初始化的CorrelationHandle“handle2”相关。

在此处输入图像描述

接下来是流程:

1) 有人调用Operation1,它为Operation2 初始化相关处理程序。因此,操作2的相关值与操作1的相关值不同,应该在执行操作1时在运行时获取。
2) 使用相关值客户端可以调用Operation2。
3) 如果关联不正确,操作 2 仍应执行,但使用自定义逻辑。

问题是当我调用第一个服务时出现异常:

CorrelationHandle 已与 BookmarkScope '{bookmark 范围 id x} ',因此不能与 BookmarkScope '{bookmark 范围 ID y}'



调试表明,即使我调用Operation1,也只有Operation2 中的“handle2”也被初始化为Receive2 活动中的某个值!所以我看来我无法重新初始化它。

有什么想法可以解决吗?

更新:

我已附加带有源代码的文件,以便您可以重现该问题。只需启动Operation1即可。

http://dl.dropbox.com/u/27847776/WorkflowCorrelation.zip

预先感谢,

-石油公司

I would like to implement next workflow scenario:
enter image description here
I have workflow service with two branches. Operation2 (Receive activity) is correlated with CorrelationHandle “handle2” which is initialized from message header.

enter image description here

The flow is next:

1) Someone calls Operation1 and it initializes correlation handler for Operation2. So the case is that correlation value for Operation2 is not the same as for Operation1 and should be obtained in runtime when execution Operation1.
2) Using correlation value client may call Operation2.
3) If correlation is not correct Operation2 should still be executed but with custom logic.

The problem is when I call the first service I get an exception:

The CorrelationHandle is already in use with BookmarkScope '{bookmark
scope id x} ', so it cannot be used with BookmarkScope '{bookmark
scope id y}'

Debugging shows that even if I call Operation1 only “handle2” from Operation2 is also initialized with some value in Receive2 activity!!! so I it seems I cannot re-initialize it.

Any ideas how it can be fixed?

UPDATE:

I have attached file with source code so you may reproduce the issue. Just launch Operation1.

http://dl.dropbox.com/u/27847776/WorkflowCorrelation.zip

Thanks beforehand,

-Petro

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

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

发布评论

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

评论(2

荭秂 2024-12-14 17:08:59

根据我的经验,您无法重新初始化关联句柄。您需要为要关联的每个键创建一个单独的关联句柄。

In my experience you cannot re-initialize a correlation handle. You would need to create a separate correlation handle for each key you want to correlate on.

贵在坚持 2024-12-14 17:08:59

不要使用选择。使用并行并将并行设置为仅在您确定对话已结束时才终止。 Parallel 有一个属性,您可以在其中设置终止条件。

Do't use Pick. Use Parallel and set the parallel to terminate only when you are sure the conversation has ended. The Parallel has a property where you can set the terminate condition.

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