locked
Workflow with id "xxxxxxxx" not found in state persistence store ???!!! RRS feed

  • Question

  •  

    Hi friends:

    Please Help me !!!  -_-||

    I use WWF beta2, StateMachine Workflow

    When run WWF beta2, I use 2 databases, the name was WorkflowStore and WorkflowTracking, the string below is the connection strings to the 2 databases in web.config

    <add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService,System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35" connectionString="Data Source=ServerName;Initial Catalog=WorkflowStore;User ID=sa;Password=MyPass;" LoadIntervalSeconds="2" UnloadOnIdle="true" />

    <add type="System.Workflow.Runtime.Tracking.SqlTrackingService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionString="Data Source=ServerName;Initial Catalog=WorkflowTracking;User ID=sa;Password=MyPass;" />

    In the "Data Source=ServerName" field, when I write a Local SQLServer IP address, like this:

    Data Source=127.0.0.1

    the WWF will work very well

    BUT:

    when I write a Remote SQLServer IP address(also in the same Intranet), like this:

    Data Source=192.0.0.100

    then I get the currentstate of the workflow instance:

    StateMachineWorkflowInstance stateinstance = new StateMachineWorkflowInstance(_workflowruntime, _instanceid);

    return stateinstance.CurrentStateName;

    the WWF will warn me this:

    Workflow with id "xxxxxxxx" not found in state persistence store

     

    WHY ???!!!

    Please Help me

    thanks a lot

    ^o^

     

    Thursday, August 24, 2006 2:19 AM

Answers

  • set a sql profiler trace on your remote server to analyse the queries ; which queries are sent ? what are the parameters  & values? does the system check the table every xx seconds ? have you used the correct scripts ? delete and rebuild the persistence db.

    You should upgrade to RC4, many problems persistence & tracking problems have been fixed in recent builds

    Serge

     

    Friday, August 25, 2006 10:58 AM

All replies

  •  

    Who can help me ?

     

    Thursday, August 24, 2006 10:20 PM
  • Most probably your instance whose guid is "_instanceid" is saved in the local database only and therefore when you connect to another database it crashes since the runtime doesnt find it there. Make sure the instance is already loaded in memory or in the persistence database you are trying to connect to (you can do that by checking the "InstanceState" table in the persistence database.
    Friday, August 25, 2006 5:53 AM
  •  

    Thanks for your reply 

    BUT

    The problem occurs when I create a new statemachine workflow instance with the romote SQLServer database

    Friday, August 25, 2006 6:17 AM
  • When you look in the database of the remote SQL Server, can you find a record in the "instanceState" table with the "uidInstanceID" you specified? Or does it remain in the local SQL Server?
    Friday, August 25, 2006 7:57 AM
  •  

    Thanks

    when I create a new statemachine workflow instance with the remote SQLServer, there is no record in the instanceState DataTable

    Friday, August 25, 2006 10:48 AM
  • set a sql profiler trace on your remote server to analyse the queries ; which queries are sent ? what are the parameters  & values? does the system check the table every xx seconds ? have you used the correct scripts ? delete and rebuild the persistence db.

    You should upgrade to RC4, many problems persistence & tracking problems have been fixed in recent builds

    Serge

     

    Friday, August 25, 2006 10:58 AM
  • Hi,

    The problem is, the Instance ID of the workflow instance created in the client is different from the one it is looking for in the persistance store.

    Fix :-

    1. Create a parameterized constructor for the workflowdataeventargs class(inherited from the externaldataeventargs) with the parameter as a GUID to take the WorkflowID created in the client.

    2.The constructor created in step1 should inherit from the base(Guid InstanceID) constructor.

    3. Pass the workflowinstance.InstanceId to the local service and create the workflowdataeventargs object with the parametrized constructor created in step 1.

    This should fix the problem.

    Regards,

    Thirumeni Nathan .C

    Sample Code

    public class RamsService : IRamsService

    {

    #region IRamsService Members

    public event EventHandler<RamsEventArgs> RequestSubmittedEvent;

    #endregion

    public void SubmitRequest(string item, Guid workflowID)

    {

    RamsEventArgs eventArgs = new RamsEventArgs(workflowID);

    eventArgs.Item = item;

    if (RequestSubmittedEvent != null)

    {

    RequestSubmittedEvent(null, eventArgs);

    }

    }

    [Serializable]

    public class RamsEventArgs : ExternalDataEventArgs

    {

    private string item;

    public string Item

    {

    get { return item; }

    set { item = value; }

    }

    public RamsEventArgs(Guid instanceID) : base(instanceID)

    {

    }

    }

    Friday, March 2, 2007 12:37 PM