locked
Is my understanding not correct? RRS feed

  • Question

  • Hello,

    Env : Visual Studio 2010 / WCF Workflow Service Application.

    I created a workflow to see whether my understanding is correct or not for resuming workflow.

    I've set up SQL persistence.

    Here is simple diagram of my workflow

    There are two Receive activities under Pick activitiy. One can create instance, the other can't. Corrleation set up by orderID.

    Like this..

    Pick - Brach1 - Trigger - Receive(MethodName - TestA)  (Checked CanCreateInstance)

                         - Action - SendRelyToReceive(Checked PersisBeforeSend) - ExceptionTest CodeActivity

          - Branch2 - Trigger - Receive(MethodName - TestB) (UnChecked CanCreateInstance)

                          - Action - CustomActivity(Some business logic) - SendReplyToReceive

    ExceptionTest CodeActivity is just throwing Exception in Execute method. (Just to simulate exception was thrown)

    Client (WCF Test Client)

    I called TestA method with orderID(which is 1)

    I looked at the sql table, and it showed that workflow instance was suspended due to the exception...(which seems right.)

    The thing that I want to test to see is whether I could resume the workflow that has been suspended due to that exception.

    So in the ExceptionTest Activity, I removed that throwing exception line, and recompiled.

    (BTW, is this right?..Recompiling the code after fixing the exception is pretty much enough letting know the suspended excpetion to resume???..you know what I am asking?

    I meant..let's suppose some scenario. You ran a workflow, and somehow unexpected error occured and suspended.....since this is persisted, it would stay in db....and ..you figured it out why the exception was thrown..and you fixed it. You may want to resume the suspended workflow from the point whether it was stopped..

    )

    In the client, I called TestB method with same orderID that I passed in TestA(which is 1)

    I thought this workflow should resume and continue..however, I got an error saying..

    "Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service."

    Am I misunderstanding something?

    How do I resume the worfklow has been suspended due to the exception after fixing that error?

    Thanks,


    • Edited by T J Wednesday, February 22, 2012 6:12 PM
    Wednesday, February 22, 2012 5:36 PM

Answers

  • I just found one thing that is very similar issue..

    http://stackoverflow.com/questions/9188025/how-can-i-resume-a-persisted-instance-by-a-new-version-activity

    It sounds like that there is no way to resume the workflow instance...

    Any other idea?

    Thanks,

    • Marked as answer by LeoTang Thursday, March 1, 2012 11:15 AM
    Wednesday, February 22, 2012 9:34 PM

All replies

  • I just found one thing that is very similar issue..

    http://stackoverflow.com/questions/9188025/how-can-i-resume-a-persisted-instance-by-a-new-version-activity

    It sounds like that there is no way to resume the workflow instance...

    Any other idea?

    Thanks,

    • Marked as answer by LeoTang Thursday, March 1, 2012 11:15 AM
    Wednesday, February 22, 2012 9:34 PM
  • Hi,

    Thanks for posting! Currently, we can't resume the old workflow instance by using a updated workflow definition. Ron Jacobs is a program manager from Microsoft, he confirmed that. In this case, we'll need to create a new instance.

    In addition, if the workflow instance was suspended due to invalid user input, in which scenario we don't need to modify the workflow definition, then we can resume the workflow instance by using WorkflowControlClient.Unsuspend Method.

    WF 4.0 WorkflowServiceHost Persistence – Part 2

    http://thedotnethub.blogspot.com/2010/07/wf-40-workflowservicehost-persistence_03.html

    Hope this helps, thanks.


    Leo Tang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 24, 2012 7:57 AM