Tuesday, 23 December 2008

Custom SSRS Event Wizard

I've just published another project onto the K2 BlackMarket site (just in time for Christmas ;), entitled 'A Reporting Services Event Wizard'.

The goal of the project was to provide a codeless and reusable way of enabling a workflow to render an SSRS report as a PDF document, which could then be used by another Event to complete a given use case.

Perhaps the most obvious use case would be a report notification whereby the report document is emailed to an external client or some other recipient who has no direct access to the system. In this scenario the SSRS Event would be partnered with the Mail Event. Another example would be to partner the SSRS Event with the SharePoint Document Event to add a rendered report to a document library, for governance purposes.

Enjoy!

Tuesday, 4 November 2008

KB 330 has been released

I believe KB 330 has been released and is available on the portal with these fixes included.

TFS IDTicket Title
15096None InfoPath client event will not warn you when you do not have a action field
1773214547If you have more than 1 central admin site the AdminResource.resx does not get installed on each of these sites and you then receive "Unknown error" when clicking on the K2 for SharePoint Tab
1854015730 Unable to set breakpoint and debug workflow
1925116277, 16417, 16687, 16665, 16666, 16802, 16880 Could not load file or assembly ’[assembly name] error after redeploy of process with web reference
1940616301IPC Failed to Start - IPC still calling dev server after moving process to production
1942916331xexecuting an update action on a worklist item will not update the process instance.
1948516315Problem assigning workitem to destination user from XML sub nodes
2166716461 Problem assigning workitem to destination user from InfoPath attribute
2323016819 Tasklist performance since upgrade to 807.2 (from 803) is slow

Sunday, 26 October 2008

Problem upgrading to 0807 with non-default K2 database names

If you are upgrading from 0803 to 0807 (4.8210.2.0) and you have non-default K2 databases names, then you may well experience the same problem we did over the weekend! During the initial installation of K2 [blackpearl] (0803) we decided to change the default database names by prefixing "K2_" to each database (so that they would be logically grouped together). Unfortunately there are hardcoded references to the Categories database in one of the update sql scripts for 0807 (4.8210.2.0) which causes the Configuration Manager to complete unsuccessfully. We have raised the issue with K2 however I thought it only fair to document the problem here and provide you with a safe workaround!

Problem

During the upgrade to 0807 (4.8210.2.0) the Configuration Manager will complete with errors because the K2 Databases will not be fully updated (see Incomplete status below):-

When consulting the configuration log file, we found that the WorkspaceAlter.sql script contained hardcoded references to the Categories database. Because our categories database was actually named K2_Categories, it could not be updated. Funnily, the error we actually received was as follows:-

"217","2008-10-25 09:25:13","Error","15","15002","ERROR","SourceCode.Database.Configuration.ConfigureDBs","15002 Database 'Categories' cannot be opened because it is offline.

This was because we did indeed have an offline database called Categories. This was a side-effect from a previous attempt to upgrade to 0807 using the 4.8210.1.1 release (We had manually taken this database offline and it was earmarked for deletion). I am guessing that if we didn't have this offline database, we would have received something more along the lines of "Invalid object name 'Categories.dbo.Categories', although I cannot say for certain.

The Workaround

To workaround this problem, we stopped the Configuaration Manager, located the WorkspaceAlter.sql file (within C:\Program Files\K2 BlackPearl\Configuration\Scripts), corrected all hardcoded references from Categories to K2_Categories (our name for the Categories database), then re-ran the Configuration Manager. All tasks now completed successfully (and in the correct order).

Hope this helps.

Thursday, 23 October 2008

K2 [blackpearl] 0807 Update KB000320 released

The first Update for K2 [blackpearl] 0807 is now available for download from the K2 Customer Portal. In response to feedback from customers, K2 have simplified their release and update processes. Beginning with this first Update to K2 [blackpearl] release 0807, they will be releasing periodic updates that will include all fixes since the last full release versions in a single installer. This means that customers need only run the latest Release installer and the latest corresponding Update to obtain the latest service release version of K2 [blackpearl] software.

Initially, there will be updates released weekly to expedite release of fixes and to ensure minimal impact on the development and deployment of K2 [blackpearl] solutions. All patches and fixes up to October 17, 2008 are included in the first update KB #320, available on the Customer Portal.

This first Update (KB000320 - K2 [blackpearl] 0807 Update (4.8210.2.320) contains the following fixes (documented in the corresponding Knowledge Base Articles):-

· KB000301 – Fixed: Error opening Document View enabled process.
· KB000302 - Fixed: Error in Reports from Process Overview.
· KB000303 - Fixed: Exception when an InfoPath form calls a SmartObject's load method.
· KB000304 - Fixed: Active Directory Query Locks Server and Returns No Results.
· KB000305 - Fixed: InfoPath form opens in IP instead of Forms Services.
· KB000311 - Fixed: Out of Office Search Screen Error.
· KB000312 - Fixed: Special Characters Error in User Search in K2 Designer for Visual Studio.
· KB000313 - Fixed: Using InfoPath with Form Services causes an error.
· KB000316 - Fixed: Error occurs on SmartObject properties of DateTime type when set as return property.
· KB000317 - Fixed: Valid SharePoint Site URL not accepted in the SharePoint Events Process Wizard.
· KB000321 - Fixed: K2 Tasklist disturbs the page layout for the K2 Web Part.

Wednesday, 22 October 2008

K2 PENS (Process Error Notification Service)

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:-

Background

Shortly 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 Overview

The 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.

Feedback

I'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

Saturday, 18 October 2008

Greetings Me Hearties

Hello and welcome to my new blog site on all things K2 and BPM related. I'm hoping that by starting this blog I'll become much better at documenting and promoting my solutions, and with any luck I can help others along the way too!

In my next post I'll be presenting a nice little solution for notifying team leaders and other stateholders when a process instance has fallen into an error state. The solution didn't take long to knock up, however I think it's a really useful utility to have.

Until then ...

Cheers
Simon