dougherty distilled

Bryan Dougherty's thoughts on technology and software development.
in

Benefits of K2 [blackpearl]

K2 [blackpearl] is the newest version of workflow software from SourceCode.  I believe it can be a valuable tool for developing line of business applications, specifially solutions that involve routing and tracking work and information between people.  While I haven't built a production solution in blackpearl yet, I think I have a fairly good background from which to evaluate the product.  I have experience building process applications in a completely custom fashion, I have some experience with Windows Workflow Foundation (WF) and SharePoint, and I have built a production application using the previous K2.net 2003 product.  I recently attended a partner training event to get some more hands on experience with blackpearl and speak with K2 folks who really know the product.  This evaluation serves as a mental exercise for me and also information for those who may be considering blackpearl.

The Basics of a Workflow Application

Applications that improve business processes usually have some basic concepts in common: users, tasks, data, rules.  Users are assigned tasks to process data.  A simple example: Employees (users) submit purchase orders (data) for approval.  Depending on the cost of the purchase and the department the requester works in (rules), a manager has to approve it (task). 

So how do you build a system like this?  Obviously you're going to start with requirements gathering and in a business process app (any app really), that can be one of the biggest challenges.  I think blackpearl can help you early on in the process.  I'm a big believer in early prototyping.  Being able to mock up an early system that walks users through the functionality is much more effective in fleshing out requirements for the final solution than simply talking with the business and drawing up how the app should work.  blackpearl allows you to rapidly build out workflows so you can walk users the flow of tasks that each user will get, at least in a rudimentary fashion, early on in the process.  I'm intrigued by one of the new built in UI options blackpearl introduces.  It auto-generates a tabular-label/textbox-style aspx page for the tasks.  The final solution will no doubt involve complex business logic and a fancy user interface and lots of other goodies, but to get moving you should be able to get a simple prototype up and running writing little or no code.

Visual Designer

I'm a visual person.  I think you have to be to understand complex business process applicaitons.  K2 blackpearl offers three different designers to model processes in: 1) Visio 2007 2) an ajax web-based designer 3) Visual Studio 2005 (and 2008 shortly, I think).  The latter is great for developers.  And the K2 marketing folks will tell you that the first two options enable your non-technical business analysts to design workflows.  I'm not buying it, though.  I don't see non-technical folks building out production workflows.  Wizards and all, there are still too many blackpearl and technical details in a real world scenario that make this unlikely.  I can see two ways this could be helpful, though.  Business analysts can start with Visio to diagram a process which can later be "blackpearled" by developers, giving the process a jump start.  Then, viewing in Viso, developers and business analysts can continue to refine the workflow by looking at it in a "common language".  I haven't tried this yet, but it seems viable.

Looking at the alternative approaches, SharePoint workflos are WF-based and therefore give you a designer to work with.  With a custom solution, you could use WF as your workflow engine and get design capabilities.  However you have a lot of plumbing to build out.

Plumbing

Building a system that tracks tasks is non-trivial.  In a custom solution, it most likely involves building a database table for tasks, writing code at write to and update the tables as events occur, properly assigning to the tasks to the correct user(s), notifying the users of their tasks, and allowing them to manage them.  It doesn't sound extremely difficult, right?  But like I said, it's certainly non-trivial.  WF gives you a good framework to build on and some basic service implementations for things like persistence via SQL Server, but you're still going to have to build out a host process, define your workflow related classes and wire everything up.  And unless you're really forward thinking, you have to do this for every application you build. 

SharePoint workflows have the concept of using SharePoint lists for tasks.  These tasks are scoped to a list within a site and without some custom work, it is difficult to create an aggregate view of tasks from various sites.  Another interesting point is that by default SharePoint deletes completed tasks after 60 days to improve performance.  You can turn that "feature" off but the onus is on you to archive task history, which could be a necessary requirement for compliance. You may want to do this with a blackpearl solution, as well, but the underlying database is built in a way that you don't need to.

Taking tasks a step further, after getting through the basics, you have to write even more code to monitor the tasks and react to tasks that have not been acted on in certain timeframe.  In K2 blackpearl this functionality can be defined in an Escalation.  You can specify rules like "if this task isn't completed in 24 hours, send an email every day" or "if this task isn't completed by a certain date specified in my business data, move to another point in the workflow".  Certainly non-trivial coding here.

We haven't even touched on how tasks are assigned or how you know when tasks are completed yet, either.  Simple assignment isn't that hard, right?  Just an AssignedToUserID column in my Task table, right?  Well for one applicaiton that might be ok.  But what if your process is more complicated.  "This purchase order needs to be approved by two of the managers in the Accounting Department."  blackpearl has the concept of Destinations, Slots, and Succeeding Rules for each activity, or milestone, in a workflow that allows you to easily define scenarios like this.

Additional Benefits

K2 blackpearl has additional benefits over a SharePoint or custom solution including versioning support, robust logging and exception handling, and MSBuild integration.  And K2 blackpearl also offers addtional advanced features.  Smart Objects provide the ability to build facades that encapsulate multiple backend datasources for use in workflows and reporting.  Another interesting feature is the Event Bus, which allows you to register events and build out an event driven architecture.  These concepts are interesting, but I'm reserving judgement until I have a chance to realy work with them.  I may try to expand on the benefits in these areas in future posts. 

Summary

In the spirit of full disclosure, I have to point out that Clarity is a K2 partner, so it would be easy to assume that I have an obligation to recommend blackpearl.  However, we're not in the business of selling K2 licenses.  We're in the business of serving our clients by building software solutions and their needs always come first.  Writing and testing infrastructure code that manages workflows and tasks is not a activity worth spending time and money on.  K2 blackpearl provides that framework, allowing us to focus on designing and building applications that solve the business problems at hand, enabling us to quickly deliver high quality process related solutions that meet their needs.

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)