Snowy
Snowy

Reputation: 6122

Windows Workflow 4 Abort from Internal Object?

I have a workflow (simple sequence) that calls InvokeMethod on an object. I would like to abort the 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.

Upvotes: 1

Views: 138

Answers (2)

user1228
user1228

Reputation:

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

Upvotes: 1

Akash
Akash

Reputation: 2371

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.

Upvotes: 0

Related Questions