我该如何处理“接收"消息?通话混乱? [英] How do I handle "Receive" calls being made out of order?

查看:90
本文介绍了我该如何处理“接收"消息?通话混乱?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模拟销售漏斗的WF4服务.它通过注册"接收呼叫开始工作.之后,有10个相似的阶段(每个阶段包含2个接收).您必须等到当前阶段验证收到的数据后才能进入一个阶段.我不确定的是,即使我的客户端应用程序不允许这样做,如何使我的工作流阻止任何人调用接收操作乱序?在我的测试控制台应用程序中,我让用户调用任何接收操作(只是因为我想看看会发生什么).

I have a WF4 service that emulates a sales funnel. It works by starting with a "Registration" receive call. After that, there are 10 similar stages (comprised of a 2 receives at each stage). You can't advance past a stage until after the current stage validates the data received. What I'm unsure about though is, even though my client app wouldn't allow for it, how can I make my workflow prevent anyone from calling the receive operations out of order? In my test console app, I let the user call any receive operation (just because I wanted to see what happens).

例如,如果我先调用Register,然后在"AddProspect"接收之前接收"AddQualification",则测试应用会返回以下异常:

For example, if I call the Register first and then the "AddQualification" receive before the "AddProspect" receive, the test app returns with an exception like this:

目前无法在标识符为"1984c927-402b-4fbb-acd4-edfe4f0d8fa4"的服务实例上执行操作"AddQualification | {http://tempuri.org/} IZSalesFunnelService".请确保以正确的顺序执行操作,并确保使用中的绑定提供有序的交付保证
Operation 'AddQualification|{http://tempuri.org/}IZSalesFunnelService' on service instance with identifier '1984c927-402b-4fbb-acd4-edfe4f0d8fa4' cannot be performed at this time. Please ensure that the operations are performed in the correct order and that the binding in use provides ordered delivery guarantees

有2件事是我不知道该怎么做的:

2 things come from this that I don't know how to do:

首先,如何处理Fault Exception以有意义的方式通知客户端并...

First, how do I handle the Fault Exception to notify the client in a meaningful way and...

第二,因为我使用的是持久性(和属性提升),所以当我进行无序调用时,被提升的属性将被卸载.客户端获得异​​常后,不会再次升级它们.

Second, because I'm using persistence (and property promotion), when I make the out of order call, the properties that are promoted unload. They are not promoted again after the client gets the exception.

有什么想法吗?

推荐答案

关于您的第一个问题,我将看Rory Primroses上有关如何屏蔽内容关联失败的文章:

Regarding your first question I'd look at Rory Primroses post on how to shield Content Correlation Failures: Managing Content Correlation Failures. In here he translates an exception into a valid Business Exception.

这篇关于我该如何处理“接收"消息?通话混乱?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆