开发者

Windows Workflow - TerminateActivity causes workflow to fault?

开发者 https://www.devze.com 2022-12-10 08:44 出处:网络
I\'m handling an exception in a FaultActivityHandler, at the end of which, I wish to end the workflow.To that end, I added a TerminateActivity to the fault handler.It looks like this causes the workfl

I'm handling an exception in a FaultActivityHandler, at the end of which, I wish to end the workflow. To that end, I added a TerminateActivity to the fault handler. It looks like this causes the workflow to fault. Is there a better way of doing this? I could use an if-else to check for a an error flag, but this would end up with a lot of nested if-else's where the right side did nothing but skip to the end of the workflow.

Am I missing an obvious way to end the workflow gracefully or开发者_高级运维 should it fault when I end it because of an exception?


I think the easiest is to add a ThrowActivity with some custom exception and catch that custom exception at the workflow level. That way the workflow will end normally but all other activities are skipped.

0

精彩评论

暂无评论...
验证码 换一张
取 消