I recently posted my first Black Market project on the K2 Underground website, entitled "K2 Process Error Notification Service (K2 PENS)". It's a Windows Service which monitors process instances on the K2 [blackpearl] Server and notifies stakeholders via email when new process errors are detected.

The project contains the full source, installer and supporting documentation and can be accessed directly from this link ->
http://www.k2underground.com/k2/ProjectHome.aspx?ProjectID=82 Alternatively, you can learn more about this utility below:-
BackgroundShortly after going LIVE with our first K2 [blackpearl] implementation, the business asked us for more visibility on broken workflow processes. Through no fault of K2, workflow process instances would sometimes fall into an error state and their associated tasks would disappear from the work list, which caused confusion amongst users.
We extended our custom work list control to allow users to toggle between 'Active' and 'Error' states, enabling users to see their broken tasks (if appropriate). We then began to look at ways to send notifications to both team leaders and K2 administrators. The first thought was to effectively write a custom logger that would plug-in to K2's extensible logging framework, however the messages received were too low a level to correlate to a process instance. A custom solution was therefore designed to notify non-technical users.
Solution OverviewThe solution was to write a stand-alone .NET 2.0 Windows service that would periodically poll the K2 Server for process errors and notify registered stakeholders via email alerts.
Because the K2 APIs do not disclose the actual date and time when a process instance errors (please let me know if I’ve got this wrong), an error cache was required to remember all previously reported errors, to prevent duplicate alerts. The cache is pruned periodically to keep it as small as possible. This is achieved by removing error items associated with process instances which have been deemed as 'fixed', 'completed' or 'deleted'.
Key Class Objects and Interactions
The Service class is the main controller and inherits from ServiceBase. This class contains a timer which is used to set intervals between jobs. After each interval the Elapsed event fires which invokes the event handler. The handler simply calls the CheckAndNotify() method which performs the unit of work. The timer interval along with many other settings can be modified via the service’s configuration file (See 'Installing K2 PENS' section for more information).
The email body containing the error report is created by transforming an XSL template containing HTML with the K2ProcessErrors collection. The K2ProcessErrors collection acts as the error cache I mentioned earlier. It is also responsible for loading itself from file (during the Service class’s OnStart event), detecting new process instance errors on the K2 Server, pruning itself (removing superfluous errors), and persisting its changes back to its XML file.
The Serializer class is used to hydrate and dehydrate the K2ProcessErrors collection to and from its XML file.
FeedbackI'd be really interested in hearing if anyone has used or extended K2 PENS. If you have any feedback (positive or negative) then please post a reply.
Cheers
Simon