Workflow foundation 4.0 message correlation and error reporting

落爺英雄遲暮 提交于 2019-12-11 05:02:43

问题


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

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.

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.

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).

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

Thanks!


回答1:


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.

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.




回答2:


Not sure if this is the answer to you problems but it may just be. If you are using a workflow instance store and property promotion you have the option to change the properties in the instance store for next time the workflow is loaded.



来源:https://stackoverflow.com/questions/2592401/workflow-foundation-4-0-message-correlation-and-error-reporting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!