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

  • Question

  •  

    Hi,

     

    I am using the Approvals Starter kit to submit an approval request. When the request has been submitted I restart the serverver. When I run the application again and attempt to submit the approval for this item I am getting Workflow xxxx with id not found in state persistence store. 

     

    How can I fix this? Many thanks in advance.

     

    Tuesday, August 26, 2008 5:09 PM

Answers

  •  

    Please take a look at the sample RaisingEvent to load workflow.

     

    http://msdn.microsoft.com/en-us/library/ms741717(VS.85).aspx

     

    This is the code from program.cs of the sample. Here we are raising DocumentApproved Event on the workflow.

    Note that we are passing the instanceid of the workflow as a parameter to RaiseDocumentApproved method. This instanceid is set in DocumentEventArgs while raising the actual event.

     

    static void OnWorkflowIdled(object sender, WorkflowEventArgs e)
            {
                // Raise the DocumentApproved event
                Console.WriteLine("\nHost:  RaiseDocumentApproval event to load workflow");
                documentApprover.RaiseDocumentApproved(e.WorkflowInstance.InstanceId, "Approver1");
            }
    Wednesday, September 17, 2008 7:05 PM

All replies

  • I've not used the Approvals Starter kit, but there's a note about this issue in the FAQ for this forum:

    Question 10:Workflow with id "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx" not found in state persistence store."

    Answer: This exception typically happens if workflow runtime cannot find the workflow instance to which you trying to send the event. Make sure you are assigning instance id of the target workflow to InstanceId parameter in ExternalDataEventArgs while raising the event.


    Hope this helps,
    Pete.
    Wednesday, August 27, 2008 12:36 PM
  • i don't understand this.

     

    "Make sure you are assigning instance id of the target workflow to InstanceId parameter in ExternalDataEventArgs while raising the event."

     

    Raising which event?

    Wednesday, August 27, 2008 6:30 PM
  • Hello,

    Could you tell us when the exception is thrown?

    Is a PersistenceService correctly configured?
    Wednesday, August 27, 2008 7:09 PM
  • it is thrown when I restart the IIS serverand try to access an existing workflow item

     

    Friday, August 29, 2008 3:26 PM
  • Have you looked at sql server to make sure there is a workflow instance record in your database?

    Wednesday, September 17, 2008 7:23 AM
    Moderator
  •  

    Please take a look at the sample RaisingEvent to load workflow.

     

    http://msdn.microsoft.com/en-us/library/ms741717(VS.85).aspx

     

    This is the code from program.cs of the sample. Here we are raising DocumentApproved Event on the workflow.

    Note that we are passing the instanceid of the workflow as a parameter to RaiseDocumentApproved method. This instanceid is set in DocumentEventArgs while raising the actual event.

     

    static void OnWorkflowIdled(object sender, WorkflowEventArgs e)
            {
                // Raise the DocumentApproved event
                Console.WriteLine("\nHost:  RaiseDocumentApproval event to load workflow");
                documentApprover.RaiseDocumentApproved(e.WorkflowInstance.InstanceId, "Approver1");
            }
    Wednesday, September 17, 2008 7:05 PM
  • How does this solve the problem?

     

    Monday, September 29, 2008 3:46 PM
  • Did it work for you?

    When you raise the event, you need to tell on which workflow that event has to sent to. This is done by setting the instanceid of the workflow in the WorkflowEventArgs

     

    Monday, September 29, 2008 7:54 PM
  • I am using the Approvals Starter Kit ( http://www.microsoft.com/downloads/details.aspx?FamilyID=A438A9B9-9F15-42EC-866F-2EA58E10DB36&displaylang=en ). How would this problem be solved in this instance?

     

    Tuesday, September 30, 2008 11:51 AM