locked
Visual tracking and persisted tracking records RRS feed

  • Question

  • I am trying to make the visual tracking come alive in my application and have a question...  I am able to persist the tracking records from running workflows as they are received (using the SqlTrackingParticipant.cs file in one of the examples) and it works perfectly.  I am now trying to piece it together with the Visual Tracking example in the SDK.  Whats the trick to re inflate the activity from the database to plug it into the source location map?  I'm guessing it is easy but I am missing a big concept somewhere.  If anyone can help with this, or point me to a code example I would appreciate it a bunch.  

    The environment : Xaml is stored in a database, workflow is run, tracking records recorded in a database, and I am building an auditor to see what happened when the workflow was run.

    Thanks,
    John 

    Tuesday, June 7, 2011 9:16 PM

Answers

  • So you've seen the SDK - have you also gone through Kushal's post?

    http://blogs.msdn.com/b/kushals/archive/2009/12/22/visualworkflowtracking-aka-workflowsimulator.aspx

    He explains the basic mapping you need is between

    Activity object (loaded from XAML) <--> XAML Line No <--> Activity ID (from tracking)

    or equivalently

    Activity ID <--> Activity object <--> XAML Line No

    The line no mapping you get from UpdateSourceLocationMappingInDebuggerService() in the sample.
    The Activity ID Activity object mapping is done in the sample from a still running workflow instance.
    However, Activity IDs per Activity should be fixed based on the structure of the workflow, so you can get it by loading another instance of the workflow and preparing it so that IDs are available - I think you can do that by using WorkflowInspectionServices.CacheMetadata()

    Tim

    • Proposed as answer by Andrew_Zhu Monday, June 13, 2011 3:01 AM
    • Marked as answer by John Hennesey Monday, June 13, 2011 11:27 AM
    Tuesday, June 7, 2011 10:38 PM

All replies

  • John,
    Just want to clarify - is your question 'how do I know the correct workflow XAML to retrieve from the database', so that the user can load a workflow based on selecting a tracking record? Or is it about the mechanics of generating a source location map (for the entire workflow) from the XAML?

    What is the exact input you have in mind which allows you to retrieve the XAML, and what is your database keyed on?
    Tim
    Tuesday, June 7, 2011 9:24 PM
  • Sorry I wasn't clear.  I have the Xaml for the workflow, and I have the tracking records emitted (well, at least the information that I am saving off as provided from the example).  I just need to put the persisted tracking information together with the workflow reinflated in the designer.  I am able to load the Xaml into the designer.  I just need to plug them together.

    Hope this is a little more clear and thanks for your help.

    John

    Tuesday, June 7, 2011 9:34 PM
  • So you've seen the SDK - have you also gone through Kushal's post?

    http://blogs.msdn.com/b/kushals/archive/2009/12/22/visualworkflowtracking-aka-workflowsimulator.aspx

    He explains the basic mapping you need is between

    Activity object (loaded from XAML) <--> XAML Line No <--> Activity ID (from tracking)

    or equivalently

    Activity ID <--> Activity object <--> XAML Line No

    The line no mapping you get from UpdateSourceLocationMappingInDebuggerService() in the sample.
    The Activity ID Activity object mapping is done in the sample from a still running workflow instance.
    However, Activity IDs per Activity should be fixed based on the structure of the workflow, so you can get it by loading another instance of the workflow and preparing it so that IDs are available - I think you can do that by using WorkflowInspectionServices.CacheMetadata()

    Tim

    • Proposed as answer by Andrew_Zhu Monday, June 13, 2011 3:01 AM
    • Marked as answer by John Hennesey Monday, June 13, 2011 11:27 AM
    Tuesday, June 7, 2011 10:38 PM
  • P.S. I've tried to go through some of the related issues in a new blog post. I hope this covers things pretty well, let me know if it doesn't.
    Tim
    Wednesday, June 8, 2011 7:15 AM
  • Wow, thanks for the great information!  You guys are definitely generous with the help...  I will digest this and get back to you.

    Thanks again,

    John

    Wednesday, June 8, 2011 12:55 PM