locked
Workflow with id xxx not found in state persistence store. RRS feed

  • Question

  • Hi ,

    I had the sql profiler running where first the SP

    exec InsertInstanceState @uidInstanceID='224352C1-CFEF-4616-91BC-80F21EC2E8E5',@state=0x,@status=1,@unlocked=1,@blocked=0,@info=N'',@ownedUntil=''9999-12-31  is called with args mentioned.

    I observed the table instancestate it showed no records after this SP

    It then calls

    exec sp_reset_connection

    and finally

    exec RetrieveInstanceState @uidInstanceID='224352C1-CFEF-4616-91BC-80F21EC2E8E5',@ownerID='B7BAE4AF-C9A2-4AB2-BDED-4593EF4AD433',@ownedUntil=''9999-12-31 23:59:59:997'',@result=@p4

    When my code tries to raise the event for 'HandleExternalEvent' construct of workflow it throws the exception with InnnerException saying Workflow with id xxx not found in state persistence store.

    my guess the problem is somewhere with the @status argument for the SP InsertInstanceState. bc'oz it is not inseritng any records when status=1 or 3.

    Kindly throw some light on this.

     

     

    Tuesday, January 23, 2007 10:15 AM

Answers


  • @status=1 means that the instance has completed. @status=3 means that the instance has terminated.

    When InstanceInstanceState is called with either of these statuses, it *deletes* the row from the DB if it already exists. If the row doesn't exist, InsertInstanceState does not insert a row.

    From your description, it looks like the workflow starts and completes successfully. This could mean that either your workflow has no other persistence points, or simply that it has completed all of its work. Afterwards, something attempts to send a message to this workflow. The exception you see is expected since the instance has completed.

    A good starting point would be to explore why the workflow has completed when you don't expect it to. Look for exceptions that get thrown (there might not be any exceptions though -- your workflow reaches the Completed, not Terminated, state.) Also consider stepping through the workflow and application logic using the debugger, or using tracking, to get at the source of the problem.

    Let us know if you're still stuck.


    1
    Tuesday, January 23, 2007 7:30 PM

All replies


  • @status=1 means that the instance has completed. @status=3 means that the instance has terminated.

    When InstanceInstanceState is called with either of these statuses, it *deletes* the row from the DB if it already exists. If the row doesn't exist, InsertInstanceState does not insert a row.

    From your description, it looks like the workflow starts and completes successfully. This could mean that either your workflow has no other persistence points, or simply that it has completed all of its work. Afterwards, something attempts to send a message to this workflow. The exception you see is expected since the instance has completed.

    A good starting point would be to explore why the workflow has completed when you don't expect it to. Look for exceptions that get thrown (there might not be any exceptions though -- your workflow reaches the Completed, not Terminated, state.) Also consider stepping through the workflow and application logic using the debugger, or using tracking, to get at the source of the problem.

    Let us know if you're still stuck.


    1
    Tuesday, January 23, 2007 7:30 PM
  • Thanks for your reply...i'll try and debug the workflow  to find out why it is getting completed when i want it to wait and listen to handle external events....
    Monday, January 29, 2007 6:08 AM