locked
How to recover an instance from error RRS feed

  • Question

  • Hi all,

    I'm designing a state machine workflow using WF4.0, and I'm wondering how can I recover from an error such as a workflow definition error, where I fix my workflow, deploy it and recover the state machine somehow to allow it to continue, without having to restart the whole process.

    Thursday, September 27, 2012 5:22 PM

Answers

  • If you are using WorkflowApplication.

                        application.OnUnhandledException = e =>
                        {
                            _exception = e.UnhandledException;
                            return UnhandledExceptionAction.Abort;
                        };

    If you abort OnUnhandledException the workflow returns to its previouis state.

    Hope this helps

    • Marked as answer by pacojones Monday, November 12, 2012 6:48 PM
    Monday, November 12, 2012 5:38 PM
  • I'm using Workflow Service, however you pointed me some directions and I've found out what I needed:

    http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/8aacfdd7-5fff-4314-b575-f12e60bebba4

    "If you are using WorkflowServiceHost. there are two options: Abandon and AbandonAndSuspend. if you use Abandon, workflow will resume running from the last persistence point. if you use AbandonAndSuspend, abort workflow instance won't reusme running automatically."

    In my case, Abandon is the answer, working as a kind of rollback, not invalidating the workflow instance for further usage.


    • Marked as answer by pacojones Monday, November 12, 2012 6:48 PM
    • Edited by pacojones Monday, November 12, 2012 6:48 PM Quote edit
    Monday, November 12, 2012 6:47 PM

All replies

  • The only facility for modifying workflow definitions on the fly (while the workflow instance is running, but currently persisted) is currently 'Dynamic Update' feature in .Net 4.5.
    Tim
    Saturday, September 29, 2012 12:13 AM
  • Considering that and the fact that this workflow won't be 4.5 at least for now, how can I recover from a suspended instance?

    For example, a specific instance, during state transition throws an unexpected exception and goes into suspended state, how can I recover it and continue it?

    Sorry I should share some details on my development scenario:

    - Workflow Foundation 4.0;

    - Using WCF workflow (xamlx);

    - State machine;

    - Using monitoring and persistence with AppFabric.

    Wednesday, October 3, 2012 4:01 PM
  • Can anyone help me on tthis question?

    If an error happens not because the workflow definition is wrong but because of external dependencies that somehow fail and send the instance into suspended state, how can I recover the workflow to the last working state (state machine) and retry the execution?

    • Marked as answer by pacojones Monday, November 12, 2012 6:47 PM
    • Unmarked as answer by pacojones Monday, November 12, 2012 6:48 PM
    Thursday, November 8, 2012 2:49 PM
  • If you are using WorkflowApplication.

                        application.OnUnhandledException = e =>
                        {
                            _exception = e.UnhandledException;
                            return UnhandledExceptionAction.Abort;
                        };

    If you abort OnUnhandledException the workflow returns to its previouis state.

    Hope this helps

    • Marked as answer by pacojones Monday, November 12, 2012 6:48 PM
    Monday, November 12, 2012 5:38 PM
  • I'm using Workflow Service, however you pointed me some directions and I've found out what I needed:

    http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/8aacfdd7-5fff-4314-b575-f12e60bebba4

    "If you are using WorkflowServiceHost. there are two options: Abandon and AbandonAndSuspend. if you use Abandon, workflow will resume running from the last persistence point. if you use AbandonAndSuspend, abort workflow instance won't reusme running automatically."

    In my case, Abandon is the answer, working as a kind of rollback, not invalidating the workflow instance for further usage.


    • Marked as answer by pacojones Monday, November 12, 2012 6:48 PM
    • Edited by pacojones Monday, November 12, 2012 6:48 PM Quote edit
    Monday, November 12, 2012 6:47 PM