This post relates to Team Foundation Server 2010 and the Scrum for Team System version 3 process template.
Now that the SfTS version 3 beta 2 is out the door, I have a chance to reflect back on some of the work that went into getting it this far. One component I am partially fond of is the Event Service.
The event service has been a component of the SfTS template solution since version 2. The chances are that you never noticed it busily working away in the background rolling up states and summing up work remaining figures. This much is also true in the version 3 template, it works quietly in background to make your project housekeeping easier and to give you useful figures. But in SfTS v3 it does a lot more heavy lifting.
So what is it?
The event service is a web application that is installed into the TFS AT (Team Foundation Server Application Tier) when you select the “Service” feature of the SfTS installer. The TFS AT passes a set of change data to the service endpoint whenever an altered work item is saved.
Using a set of configuration rules, the service examines the changes to determine if they affect any work items in the project. If changes to work items are required, the rules define the new values and the service updates the work item(s).
You can see the service changes made to your work items by examining the work item history. The name of the service and the action taken is included in the history details.
Controlling the service and synchronising work items:
The installed web application includes three service end points. The first is called by TFS in the event of a work item change, the other two are called manually by the TFS administrator.
Service Control
Unsurprisingly, this web service end point allows you to control the service! Actually, it allows you to start, stop and check the status of the work item changed service.
The service control end point is located at:
- http://[TFSHOST]:[TFSPORT]/ScrumforTeamSystem/3.0/ServiceControl.asmx
Synchronise All
The “Sync All” service schedules a special job in the event service queue. Upon de-queuing a sync all request, the service will load all work items [in the specified project] and apply any rule matches. In this way, you can use this service to correct and synchronise all the work items. Obviously, this is a process intensive exercise and should only be executed when the TFS instance is not under any heavy load, possibly out of office hours.
This service end point requires two parameters;
- tfsAddress – The project collection URL.
- projectName – The project name to synchronise.
The sync all end point is located at:
- http://[TFSHOST]:[TFSPORT]/ScrumforTeamSystem/3.0/SyncAll.asmx
Under the hood:
As the service runs in background, you can’t see much action while it’s working. However, you can get to see more by enabling event logging.
Event Logging
To set this up, you will need to create and edit files on the TFS AT.
- Create an empty, accessible log file.
The event service runs under the same app pool as the TFS AT. In order to make log entries, the app pool user account must have write permission to the target log file. The easiest way to accomplish this is to create local file and give the “everybody” group full permission over it.
Example: c:\users\[Profile Name]\AppData\Local\Temp\SfTSEvent.log
- Open the event service “web.config” file.
The configuration file is located at:
C:\[Program Files]\Scrum for Team System\Services\web.config
Note: You may have to open the file with elevated privileges.
- Add the log file path to the relevant setting value.
Change:
<setting name="LogFilePath" serializeAs="String">
<value/>
</setting>
To:
<setting name="LogFilePath" serializeAs="String">
<value>c:\users\[Profile Name]\AppData\Local\Temp\SfTSEvent.log</value>
</setting>
- Save the config file.
Now the details of the event service actions will be written to the log file.
Well that's it for a high level look at the event service. In future posts I'll discuss the Work Item Changed event, Transition rules, Aggregation rules and customisations.
Links
Regards,
Crispin Parker,
Senior Practice Consultant,
EMC Consulting.