开发者

Windows Workflow - TerminateActivity causes workflow to fault?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜