Can't seem to get StateMachineStateTracker working with persistence

Jun 25, 2012 at 1:22 PM

StateMachineStateTracker (microsoft.activities.extension) is just what I'm looking for to allow me to query "what's next?" transitions - and it works great - except when I try to use it with persistence.

I've tried to follow the instructions, but every time I retrieve a workflow from the DB, the tracker is empty. Also, the InstancePromotedPropertiesTable is empty - from what I understand, StateTrackerPersistenceProvider is supposed to populate this with XML.

Are there any common gotchas that I should look out for? Would it be possible to post a working sample?

Note that I tried working with the "Tracking State Machine" sample - it's VS 2012 RC, but targets .NET Framework 4.0.1, which seems odd. I targeted it to 4.5, but get an error upon running. Guess I need to break down and install 4.0.1.

Thanks for any tips/help!

Dave

Jun 25, 2012 at 9:09 PM

OK, some follow-up:

  • After installing .NET 4.0.3, the Tracking State Machine sample worked fine in VS 2010.
  • I found an important line of code in the sample's InitializeInstanceStore() that I was missing: StateMachineStateTracker.Promote(this.instanceStore);
  • I believe I found a bug in the current version - reported here: http://wf.codeplex.com/workitem/10260