Windows WF3.0 - get activity information from TrackingRecord object

Locked Windows WF3.0 - get activity information from TrackingRecord object

  • Monday, August 13, 2012 5:06 AM
     
     

    Hi,

    Is it possible to get the activity object from TrackingRecord type? Am using Windows workflow3.5 framework.

    Reason being I want to extract the input data that goes into an activity.Below is the code am using to get the tracking information, it extracts an activity's name and execution status  currently.

    protected override void Send(TrackingRecord record)
            {           

                // These are three different types of tracking records available.
                ActivityTrackingRecord atr = record as ActivityTrackingRecord;
                WorkflowTrackingRecord wtr = record as WorkflowTrackingRecord;
                UserTrackingRecord utr = record as UserTrackingRecord;
             
                Debug.WriteLine(string.Format("Received an tracking record [{0}]" , record.EventDateTime.ToShortDateString()));

                if( atr!= null)
                {
                   
                    WriteToLog.Log(string.Format("{0},{1}",atr.QualifiedName, atr.ExecutionStatus));
                }

                else if (wtr!= null)
                {
                    //MessageBox.Show("\tReceived an workflow tracking record");
                    //MessageBox.Show(string.Format("\t\tName[{0}]", wtr.TrackingWorkflowEvent.ToString()));
                }

                else if (utr!= null)
                {
                    //MessageBox.Show("\tReceived an user tracking record");
                    //MessageBox.Show(string.Format("\t\tName[{0}]", utr.UserData));
                }

            }

All Replies

  • Wednesday, August 15, 2012 7:37 AM
    Moderator
     
     Answered

    Hi,

    ->Is it possible to get the activity object from TrackingRecord type?

    We can't get the activity object from TrackingRecord. "To get data from the executing activity use an extract in your tracking profile.  We'll fetch the data requested in the extract and send it with the ActivityTrackingRecord in the Body property.  This provides a flexible structure for tracking data that can be modified after the workflow type has been deployed without recompiling the workflow type or the tracking service"

    Why doesn't ActivityTrackingRecord.ContextGuid match any context guids in the rootactivity?

    http://social.msdn.microsoft.com/Forums/en-US/windowsworkflowfoundation/thread/98e81ad2-9a90-4381-b221-d8429345e4c4

    Hope this information helps, thanks.


    Leo Tang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.