如何在 WF4 StateFlow(平台更新 1)中使用相关性
我有一个 WF 服务 (CustomerProvisioningService),它接收请求消息并立即运行 StateFlow (CustomerProvisioningStateFlow),并将其标记为 CanCreateInstance。
流中的第一个状态有一个顺序流作为其 Entry 活动,这是一个长时间运行的工作流,具有自己的 Send 和 ReceiveReply 模式来调用和接收额外信息 (ProvisionCustomerActivityFlow)。这个工作流程也可以CreateInstance。
我认为对于顺序流,我需要根据内容 (CustomerId) 管理相关性,这样我就可以识别底层 AppFabric sql 持久性中的持久工作流。
随后,我在 StateFlow 中进行了其他操作,这些操作由 WCF 服务调用表示,类似于:
SuspendCustomer(string customerId)
我假设我需要通过与 StateFlow 中的 CustomerId 关联来选取正确的 StateFlow 实例,但我找不到在StateFlow,既不通过添加 CorrelationInitializers 也不引用本地 CorrelationHandle 变量。
现在我想知道我是否需要 StateFlow 上的关联,如果需要我该怎么做?或者我在这里误解了什么?
非常感谢
布莱恩
I have a WF Service (CustomerProvisioningService) that receives a Request message and immediately runs up a StateFlow (CustomerProvisioningStateFlow) and which is marked as CanCreateInstance.
The first State in the flow has a Sequential flow as its Entry activity which is a long running work flow with its own Send and ReceiveReply pattern to call out and receive extra information(ProvisionCustomerActivityFlow). This workflow CanCreateInstance too.
I presume for the sequential flow I need to manage correlation based on Content (CustomerId) and in this way I can identify the persisted workflow in the underlying AppFabric sql persistence.
Subsequently I have other operations in the StateFlow which are represented by WCF Service calls similar to :
SuspendCustomer(string customerId)
I am assuming that I need to pick up the correct StateFlow instance by correlating with the CustomerId in the StateFlow but I can find no way to apply Correlation in the StateFlow, neither by adding CorrelationInitializers nor referencing a local CorrelationHandle variable.
Now I am questioning if I need correlation on the StateFlow and if so how do I do it? Or am I misunderstanding something here?
Many thanks
Brian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要设置请求消息关联以将消息路由到同一工作流实例。我的博客上有一个示例 此处了解如何设置。该示例使用序列,但过程与状态机相同。
You need to setup request message correlation to route messages to the same workflow instance. I have an example on my blog here about how to set this up. The example uses a Sequence but the process is the same with a state machine.