Windows Workflow Foundation 4 (WF4) error handling

What is the best way to get error messages from a WF4 workflow back to an ASP.NET MVC hosting application? I need the workflow to not be interrupted, but to continue to be active, and then send the message back to the hosting application regarding the error, so the user can take an alternative action, but I'm not sure how to do it.

+5
source share
3 answers

To maintain uptime, you need to catch an exception in your workflow. Add a TryCatch action to your workflow, and in the Catch block you can use either Submit or a custom action to send data to the main application.

The only exception is to use WorkflowApplication.OnUnhandledException with persistence and specify an interrupt. In this case, the state of the memory in the working state is simply deleted, and the workflow can be restarted for the last stored state. If you go this way, you need to make sure that with Perist activity your workflow is saved whenever something cannot be redone.

+6
source

TryCatch , WF4. , UnhandledException , .

- TryCatch WF4. : http://msmvps.com/blogs/theproblemsolver/archive/2009/11/27/trycatch-activity-in-wf4.aspx

catch, , , TrackingRecord, , .

+2

, ...

WorkflowApplication.OnUnhandledException, , , , . , .

WorkflowApplication.PersistableIdle , . , , . , .

extension, . , , . Bookmark + extension .

-1

All Articles