TFS Event Filtering#

With today's release of TfsAlert a question will no doubt get asked; what really is a Filter Expression?  Short answer, an expression to filter events sent from TFS.

Long answer.

Formally known as Visual Studio Event Filter Language or VSEFL, it feels very much like a SQL expression and/or like WIQL. These filters are added with the creation of the subscription itself.  This becomes really important when you're consuming any part of the TFS eventing system.  Let's use TfsAlert for example.  It's 100% driven by the TFS eventing system and while there are a number of events once can subscribe to lets just focus on two and further provide some concrete examples.

  • CheckinEvent
  • WorkItemChangedEvent

Lets also assume you have a TFS server which has more than one TFS project and more than one person using it.  Given that when you startup TfsAlert without any subscription filters you're going to get a number of events, some of which I am sure you don't care about.  The following questions usually come next.  How can I

  • filter a CheckinEvent for my set of team project(s)?
  • filter only WorkItems assigned to me across any TFS project?
  • filter WorkItems for my area?

A typical CheckinEvent filter usually looks something like the following:

" TeamProject = 'Project Name' "
" TeamProject MATCH 'Project Name A|Project Name B' "

Those two expression actually answer that first question. The expression simply states we want to filter on TeamProject where the it either = 'Project Name' or MATCH all project which equal Project Name A or Project Name B. The "key" ( in this case TeamProject) is derived from that events schema.  So what operators are available?

= (equals) String, Int, Enum, Date, Bool
< (less than) Int, Enum, Date
<= Int, Enum, Date
> (greater than) Int, Enum, Date
>= Int, Enum, Date
Under (Quickly match file specs) String
Match (Regular Expression Match) String
Like (Simple match) String

Matching is pretty easy and all completed on the server side before the event is ever sent.  What you really need to understand is each particular events schema.  That events schema ultimately defines the actual event and what you have the ability to filter on.  When TFS installs you can find the default schemas @ %ProgramFiles%\Microsoft Visual Studio 2005 Team Foundation Server\Web Services\Services\v1.0\Transforms.  You can further create your own event types, but I will save that for another post.

This release of TfsAlert will actually publish the message you've received to the event log just so you can easily look at it.  This will really help when you want to build some filter expressions.  This can also be turned off by setting the value attribute from 3 to 0.

<switches>
  <add name="General" value="3" />
</switches>

Want to dive deeper, all the eventing information you ever wanted to know can be found @ http://msdn2.microsoft.com/en-us/library/aa398965.aspx

Wednesday, November 01, 2006 2:08:36 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

TfsAlert 0.3.0.0 Released#

Today we have released the initial TfsAlert release 0.3.0.0.

Prerequisites

.NET 3.0 is required since this is built on top of WCF. If you’re running this from Vista you will not need to install the .NET 3.0 framework.

Installation Notes

This version runs under Windows XP.

If you would like to run on Vista you have to install to another location outside of %programFiles% so you the proper security to configure it. We are currently addressing Vista UAC compatibility.

Once installed you HAVE TO properly configure it. This will be fixed in the next release.

  • One the following %programfiles%\TfsAlert\TfsAlert.exe.config and set the following items:
    • teamFoundationServer, your TFS server
    • userId, your user id
    • selected, select the events you would like to subscribe to.
    • filterExpression, filter placed on that event
  • Open port 9999 on your Windows Firewall. This is also configurable if you would like to listen on another port.

What's New

Base architecture with basic event notification.

What's Next

http://www.codeplex.com/WorkItem/List.aspx?ProjectName=TfsAlert

Contact Us

CodePlex: http://www.codeplex.com/Wiki/View.aspx?ProjectName=TfsAlert

Wednesday, November 01, 2006 9:45:44 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

TfsAlert Source Migrated To CodePlex#

This weekend I was hard at work tidying up the TfsAlert source base, fixing Vista breaking changes.  This morning I finally migrated it to CodePlex.  Right now we are actively working on the package for an initial release.  We should have that released later this week.

If you download the source there are a few things to note.

  • The source base with all written TDD but using partial classes.  Our deployment package will strip out the tests but right now if you run you will need those testing assemblies.
  • We currently call the TFS OM directly to subscribe so you have to have those assemblies installed .  This will be changed in a future release to call the Web Service directly. 
  • Currently listens on port 9999.  You have to manually open the Windows Firewall so it can listen on that port.
  • You have to setup the config.  We don't have a UI screen for that yet.  There are just a few settings in the config file.
    • Add your TFS Server.
    • Add your User Id
    • Select the events you want to subscribe to, Selected == true / false
    • Add a filter expression for that event.

There is one critical bug we are currently addressing.  Right now if your network interface drops out and you are assigned a new IP we orphan that event subscription in TFS and don't get a chance to clean it up.

Monday, October 23, 2006 10:04:50 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

All content © 2010, Clark Sell
On this page
This site
Calendar
<July 2010>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: