Friday, January 30, 2009

Professional K2 blackpearl

Our book is out! And an excelent overview of what BPM realy means all the way through to deep under the hood of K2 blackpearl.

Since this is the first book on K2 blackpearl, you will find a broad range of topics in this book, from the market in which K2 blackpearl is aimed to the architecture of the platform, from how to approach process design to developing your own custom user manager.



Friday, November 21, 2008

Learn from Microsoft and K2 how Nissan drive more productivity from SAP

Learn from Microsoft and K2 how Nissan drive more productivity from SAP

Microsoft and K2 would like to invite you to an afternoon session of presentations and networking to help you further your SAP investment. After refreshments and a welcome from your hosts you will gain an insight into how Microsoft works closely with SAP and their future strategy as partners. Also learn how one of our customers, Nissan, enhanced their productivity with workflow and SAP linking to enable updates, amends and automatic postings with limited user intervention. This session will be hosted by the Dynamyx Business analyst, who will explain the business drivers and processes involved, the project manager sharing experiences gained in delivering the solution across the region, and the systems architect who will present details on how to achieve scalability when linking workflow to SAP.

The event will end with networking and drinks to wish you all the best of the season with the backdrop of the night time city view.

Date: 10 December 2008
Time: 14:00 – 17:30
Venue: Radisson Edwardian Hampshire
To register call 0870 166 6628 or click here to register online.

Wednesday, October 29, 2008

Breakfast Briefing: Microsoft based Business Process Management

Discover the benefits of embracing Business Process Management using Microsoft based technologies.

We will be presenting Microsoft® BizTalk® Server and K2 blackpearl focused around business-process automation and application-to-application integration. Dynamyx in Partnership with K2 and Microsoft invites you to join us for a breakfast seminar in London, UK. Breakfast will be available from 8:30.

30 October 2008

Arrival (8:00 - 8:30)
Light Breakfast (8:30 - 9:00)
Welcome from Microsoft Mr Harsha Karunaratne, SOA and Process Platform Technical Specialist (9:00 - 9:30)
Business Benefits of BPM Mr Ruan Scott, K2 VP EMEA (9:30 - 10:00)
Scenario Demonstration Mr Gabriel Malherbe, Dynamyx Technical Director (10:00 - 10:45) Q&A (10:45 - 11:00)
A technical workshop will be held from 11:00 to 12:00.

http://www.dynamyx.net/resources_EventsReg.aspx?EventID=74950

Wednesday, May 28, 2008

Writing custom code in a K2 blackpearl client event

Long time no blog...

Topic that’s had some recent airtime in Dynamyx. How to, or more specific, what’s the most correct way to write custom code behind a K2 blackpearl client event. This specific use case came about when we had to send an email from the client event that needed a high level of customization.

Firstly, looking back at the K2.net 2003 days, this was a simple right click on the client event and hacking away at the generated code. The drawback was that you bought a one way ticket... you could never run the wizard again and retain your custom code. The new K2 blackpearl authoring model allow us to customize the underlying code of an event but maintain the integrity and ability to re-run the event's wizard.

The question is, where do you put your code then?

Let’s start by looking at the code behind a client event. Right click on the client event and select the View Code Event Item option:



You'll be presented with the XOML schedule that makes ups the client event:

The idea is to add you own WF code activity either before or after the core client event code (depending on what you want to do). In my example I dragged a simple WF code activity from the Visual Studio toolbox and dropped it at the end of the schedule. To get to the event handler of the code activity, right click on it and select Generate Handlers:



And write you own custom code:

Thanks to Colin Murphy and Jey Srikantha (fellow K2 insiders) for their input in this solution.

Thursday, December 20, 2007

Actions leads to Outcomes

In enterprise solutions it’s impossible to keep logic in one place. We are faced with BPM rules engines, line of business applications with their own schemas, input and output limitations, business rules, UI rules, drinking rules and speed cameras! Although it would be great to have them all in one place, as with red tape in governing organs we cope with adapting our senses to read and adhere to this logic in an easy way. K2 blackpearl makes a few effective attempts at centralizing logic and offering us tools to use logic from elsewhere.

In K2 2003 a user task was a good example where we often had routing logic in the workflow that had to be duplicated in the UI. For workflow routing our UI has to know what options the user had when auctioning a task and then the succeeding rule and all line rules out of the activity had to know about this as well. Maintenance was a nightmare.

In order to centralize routing logic, my team built a complete framework on K2.net 2003 that allowed us to automatically render the user interface for a workflow client event by looking at the available lines out of an activity that hosted the client event (if you are not bothered about the battles we had in 2003 or are a K2 blackpearl only client, skip to ‘In K2 blackpearl” sections).

In K2 2003

Here is the sample of the framework in action:


Logic of the workflow is automatically available in our business entities by purely inheriting from a specific base class (Customer in this example with an associated Customer Approval workflow instance) so accessing the logic defined in the workflow via client UI code looks like this:

Public Sub LookAtCustomerActionsAvailable()

' load a biz entity
Dim cust As Customer = _
RemoteServer.GeneralManager.Load(Of Model.Customer)(1)

' get the workflow context using the framework
RemoteServer.WorkflowManager.PopulateContext(cust)

' get the list of actions from the biz entity
For Each action As Action In cust.ActionsAvailable
Assert.IsNotNull(action, "bollocks test")
Next


' take the first action
cust.ActionToBeTaken = cust.ActionsAvailable(0)

' save the entity and action the workflow using framework

RemoteServerHelper.GeneralManager.SaveEntityObject(cust);

End Sub

Powerful feature, but because it is our own framework extensions on top of K2 2003, it is hard to maintain. For example, all our client events, lines, succeeding rules and line rules have to adhere to our framework requirements, i.e. “what action will lead to what line and what line represents a specific outcome”. We have to add and maintain XML stubs on all these entities, i.e. here is a line telling the framework what action will lead to its outcome:


Now that K2 blackpearl is available with the concept of being able to take a client action that leads to an outcome build into the product, life is much easier.

In K2 blackpearl

Blackpearl defines the concept of a client event in the workflow being aware of what actions can be taken on it. This is defined when creating the client even in the process designer. The wizard will also allow you to define outcomes and link the action that a user can take with a specific outcome based on your own rule set. Once the client receives the task at run-time, the task contains the available actions and the UI can automatically render this.

Here is a sample process:


When I added the client event, I automatically added two actions with two outcomes, North and South. I also asked the client event wizard to create a line for each outcome… not a single line of code needed for this.

Once I’ve started a new process instance and look at the allocated client task, I can see the two actions available: - this picture from the Workspace work list:



Job done! I can link these outcomes to my UI using either the various UI integration events available (InfoPath Client Event and Form Generation Client Event) – zero code required.

Alternatively I could render my own UI using the Client API. This sample code opens a connection to the K2 server, opens a task based on its serial number and then loops the available actions. It then takes the first action on the task in order to complete the client event:

static void LoadActions() {
// SourceCode.Workflow.Client.Connection now implements
// IDisposable...

using (Connection con = new Connection()) {
try {
// open connection and load task
con.Open("localhost");
WorklistItem task = con.OpenWorklistItem("SERIALNUMBER");

// loop the actions
foreach (Action action in task.Actions) {
Console.WriteLine(action.Name);
}

// action task (assume there is at least one)
task.Actions[0].Execute();

}
catch (Exception exception) { throw exception; }
finally { con.Close(); }
}
}

Thanks to the ambitions of the development team at Dynamyx that inspired the creation of the Dynamyx K2 framework that’s made life so much easier for us and our clients. I dedicate this blog entry to them. Rob, Ian, Trent, Kenny, Carlos and JT.