Saturday, 2 October 2010

Workflow Tracking Profile Editor

Here is a great link on Dennis van der Stelt's blog about info. about the workflow tracking profile editor.
This tool makes it easy to create a tracking profile. It allows you to load up a WF4 XAMLX file. It then shows the editor and you’re allowed to browse through all (composite) activities. After right-clicking an activity (with a blue circle on it) you can specify what you exactly want to track. It even knows everything about arguments and (scoped) variables so you can use checkboxes to turn them on or off.

Here are some screen shots:

So following on from my other post:

I will create a simple tracking profile for my workflow.

Currently my workflow is using a default tracking profile that is set by my root web.config:

You can see that it is using the "HealthMonitoring tracking Profile"which seems to be the default one. there are a few others to choose from and to configure these you:

  • right click on your WF in IIS and select "Manage WCF and WF services" and then "Configure..."
  • Click on Monitoring
  • then use the slider to choose what you require.

And you can see that in my web.config that is local to my service that I have no tracking profile:

So I will use the Workflow Tracking Profile Editor to point to my current workflow definition and add a tracking item.

For the purposes of this exercise I have added an int32 variable to my xamlx file called:

I then use an Assign activity to set the variable. I suppose I could track the expenseId that hangs of my custon ExpenseResponse object. I tried that before and I could not get anything to appear in appFabric. So for now i'll just stick with a simple integer.

I then right click in the blue spot in the Workflow Tracking Profile Editor:

and select "track variables in this activities scope...":
And for now ill just select every event type for my variable:

I then save my new tracking profile using the Workflow Tracking Profile Editor and insert the resulting Xml into the web.config of my xamlx service.

Now that I have done this I will fire up my workflow using a windows form client as mentioned in my earlier blog:

More on this later... still learning

You can see that I have set a break point on the assign activity that sets the TempTrackingExpenseId variable in my ExpenseService.xamlx workflow:

After I let the debugger run to the end I expect that I have 1 workflow active and persisted in the persistence store and therefore showing on the appFabric dashboard.

So if I click on the Active persisted WF instances I will see the workflow in question.

If I right click and select "view tracked events" I can see all the events / activities that have occurred in my workflow already. 

If I just scroll I may be able to find the event im looking for, and therefore the TempTrackingExpenseId. What if, however, there are hundreds of activities in my workflow?

I can use the query options to find the data I am looking for. So if a user calls me up and tells me that he is waiting on the approval of an expense and the Id of this expense is 116 then I can select:
Tracked workflow variables
Name: 'TempTrackingExpenseId'; Value: '116'
as shown below:

The result would be as follows:

As you can see, Especially compared to workflow 3.5, this is and could be very useful in keeping up with where your workflows are at.

A great link about tracking:

That's all for now.