工作流服务关联
我想实现下一个工作流程场景:
我有两个分支的工作流服务。操作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:
I have workflow service with two branches. Operation2 (Receive activity) is correlated with CorrelationHandle “handle2” which is initialized from message header.
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据我的经验,您无法重新初始化关联句柄。您需要为要关联的每个键创建一个单独的关联句柄。
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.
不要使用选择。使用并行并将并行设置为仅在您确定对话已结束时才终止。 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.