开发者

Windows Workflow 4 Abort from Internal Object?

I have a workflow (simple sequence) that calls InvokeMethod on an object. I would like to abort t开发者_JS百科he entire workflow based on code within the object.

This is kind of like http://msdn.microsoft.com/en-us/site/dd560894 but that is aborting from top-down, and I want to just halt the whole workflow from bottom-up. How to do that?

Thanks.


You can do this from a NativeActivity by calling NativeActivityContext.Abort. How are you calling the InvokeMethod?


Do you really need to abort the workflow or is it OK if the workflow just ends? If you are happy with it ending, then I think you have two options depending on the complexity of the workflow:

  1. Use an If activity and have one branch doing nothing when the condition (based on the result of your InvokeMethod call) is not met.
  2. Use a Flowchart instead of a Sequence, as that will allow you to implement more complex exit logic.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜