Workflow Foundation 4.0 消息关联和错误报告 [英] Workflow foundation 4.0 message correlation and error reporting

查看:15
本文介绍了Workflow Foundation 4.0 消息关联和错误报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工作流服务,可以运行并执行许多不同的操作(例如 Web 服务调用).

I have a workflow service that runs and performs a number of different operations (such as web service calls).

如果这些操作之一失败,我会调用错误报告 Web 服务来通知单独的系统我的一个工作流操作失败.由于错误可能类似于 Web 服务关闭,我循环并重试此操作,直到它起作用为止.

If one of these operations fails I call an error reporting web service to notify a seperate system that one of my workflow operations has failed. As the error could be something like the web service being down, I loop and retry this operation until it works.

虽然有时我传递给此 Web 服务的数据有问题并且需要更改.所以我需要能够连接到这个正在运行(但延迟)的工作流并更改本地工作流变量,然后重新运行操作.

There can be times though when the data I'm passing to this web service is faulty and it needs changing. So I need to be able to hook into this running (but delayed) workflow and change local workflow variables and then re-run the operation.

我已经查看了工作流 4.0 中的消息相关性来实现这一点,但由于延迟活动在我正在运行的工作流实例中处于活动状态,任何第二个服务调用都不会执行任何操作(就像延迟活动阻止了任何其他请求一样).

I've looked at message correlation in workflow 4.0 to achieve this but because the delay activity is active in my running workflow instance, any second service call doesn't do anything (it's like the delay activity is blocking any other requests).

我已尝试将CanCreateInstance"设置为 true 和 false,但没有帮助.

I've tried setting 'CanCreateInstance' to both true and false but it doesn't help.

谢谢!

推荐答案

您需要将 Delay 活动放在 Parallel 容器中,并在其中包含接收任务.这意味着它会在等待循环处理的同时监听请求.

You need to put the Delay activity inside a Parallel container, and also in that have the receive task. This means that it will be listening for requests while waiting for the loop to process.

有关消息关联如何工作的示例,我发现 Tailspin Travel 示例非常有用.选中等待确认"框中的接收批准"任务,了解如何将请求联系在一起.

For an example of how message correlation works I found the Tailspin Travel example very helpful. Check the "Receive Approval" task within the "Wait Confirmation" box to see how to tie the requests together.

这篇关于Workflow Foundation 4.0 消息关联和错误报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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