
Solution Architecture Overview
Bob Maggio, Architect, SourceCode
Bob went through a K2 [blackpearl] solution showing much of the detailed architecture. A couple of noteworthy items to share here are:
1. When working with a Smart Objects, you can add a process level reference to the Smart Object in the solution. By doing this, each activity or event will point to the Smart Object in the reference. Not using the referenced Smart Object results in each call to the Smart Object adding to the operating cost of your solution and thus negatively affecting performance.
2. K2.Net 2003 and K2 [blackpearl] differ regarding activity instances. In K2.net 2003, there would be an activity instance for each person assigned to a task. In K2 [blackpearl] there is now a single activity instance regardless of the number of people assigned to a task.
K2 [blackpearl] Architecture Overview
Koos du Preez, CTO, SourceCode
Koos went through the some of K2 [blackpearl] architecture. The first thing he spoke about though was performance. Although not an architecture item, the product architecture is a major consideration in achieving optimal performance. Performance will be much improved with the upcoming 803 release. While the main goals of this release are 64 bit support and improving the K2 [server] installer, it includes significant performance enhancements. The workflow server performance is much improved; primarily process execution. The worklist and worklist item performance has been improved significantly as well.
Koos also touched on the following items:
1. Workflow Authoring
K2 allows for authoring of processes using any designer, viz. Microsoft Visual Studio 2005, K2 Studio and Microsoft Visio 2007. It has a common authoring API which generates a KPRX file used by all designers. It also contains custom configuration data and customizable pre-built workflow schedules - which don’t require code generation. The schedules are created using XAML. One important point to note is that the extender files should not be checked into source control, as it will result in the extender files becoming corrupted.
When the solution is built, the result is compiled executable artifact which are contained in a MSBuild package ready for deployment. Deployment executes the MSBuild package which in turn results in the following steps being taken:
i - Obtaining environment setting
ii - Deploying artifacts using build tasks
a - creates MOSS artifacts
b - uploads MOSS artifacts
c - deploys the workflow
d - deploys the events
e - deploys Smart Objects
One thing to remember is that Service Objects need to be manually deployed to other environments. Lastly, a great tip regarding deployment is that when deploying using the command line tool, detailed information is returned as well as error information, e.g. an error that might be returned using this method could be “Error creating MOSS site”.
2. Runtime
At runtime, a .Net AppDomain is created on the K2 [server]. All process definitions and behaviour is loaded from the K2 databases. Isolated and versioned execution of processes start.
3. K2 Layered Architecture
i - K2 [blackpearl] comes with a K2 SSO (Single Sign-On) - see below for more.
ii - Communications are pluggable by design. Currently the K2 API to the server uses TCP on port 5555. This can be replaced by WCF or an alternative protocol if needed.
iii - Roles can be authenticated using AD (Active Directory), LDAP or Microsoft SQL Server amongst others.
iv - The K2 [server] can listen for K2.Server 2003 and K2 Studio 2003 using TCP over port 5252.
4. K2 Single Sign-On (SSO)
The K2 SSO is based on a primary ID. Line of business (LOB) IDs are attached to the primary ID. It supports multiple backend LOB credential caching using pluggable authentication providers. These can have multiple instances of the authentication providers e.g. multiple SAP instances can be attached. The K2 SSO supports Windows SSPI (NTLM and Kerberos).
The K2 SSO ships with the following authentication providers: AD; SQL; Siebel; SAP; SalesForce. The K2 SSO is pluggable and an SDK exists for creation of custom authentication providers. It is highly secure, making use of SQL Server symmetric keys in turn protected by system credentials. Caching can be set to expire or turned off. Automatic prompting, validation and caching of credentials occur the first time an event results in a LOB being hit.
K2 SSO supports seamless Smart Object integration. The way it works is as follows:
i - The API requests the Smart Object method call
ii - Marshalling calls the Smart Object Exec with broker package
iii - The Service Instance requests the LOB credentials
iv - The Security Framework accesses the SSO cache
v - If the credentials are not cached then the Security Framework prompts the user for them
When a prompt is requested, it is the result of an error being thrown. If not handled, then the process will be in error state. This needs to be taken into account when using Microsoft InfoPath as a user interface.
5. K2 Databases
There can be up to 14 K2 databases. They can be configured for performance by adjusting the threads for the processing database and the log database. In the k2server.setup file, the <K2ThreadPool> tag is set at 20 thread by default for both databases. These numbers can be adjusted e.g. processing uses 25 or 30 threads and the log 15 or 10 threads. It is also possible to rename the databases as long as the names are updated in the configuration manager.
6. Common Logging Framework
The logging framework allows for logging events to be sent to multiple targets, including:
i - Microsoft SQL Server
ii - MSMQ
iii - File
iv - Windows Event Log
v - Console
The verbosity and severity levels for each target can be set. The message queue used to send logging events can be bypassed, resulting in synchronous real time logging of messages. This does affect overall performance though. This is done by opening the HostServerLogging.config and altering the <AsyncQueueEnabled> tag. When making this alteration, the service needs to be restarted.
It is also possible to create predefined messages taking parameters using text, etc.
7. Monitoring (Windows PerfMon)
The following are tracked using PerfMon:
i - Processes Started, per second
ii - Worklist Opened, per second
iii - Worklist items finished, per second
iv - Process Memory Usage
v - Process Thread Count
vi - Process Modules Loaded
vii - TCP Bytes Retrieved Total, per second
viii - TCP Bytes Sent Total, per second
ix - TCP Concurrent Connections
vii - TCP Connections Opened, per second
Business Process Management Today
Maureen Flemming, Program Director, Business Process, Integration and Deployment Software, IDC
The afternoon session had Maureen give some insight into the market today and Business Process Management. The session was highly informative, although I did not take too many notes.
As is clearly evident, the second day was busy and managed to live up to the high standards of the day 1. Here’s to day 3, but before that there are a few bets to win at the bowling alley this evening.
SourceCode, K2, K2[blackpearl], Process Management, K2 SSO, K2 Databases, Monitoring K2, K2 Logging Framework, K2 Workflow Authoring
April 14th, 2008 at 4:50 am
[…] Day 2 - http://delpiccolo.com/2008/04/13/2008-k2-insiders-conference-day-2/ […]
April 14th, 2008 at 6:02 am
Hi Sergio,
Nice meeting you last week. Thanks for the banana.
Josh
April 14th, 2008 at 7:08 am
Hi Josh,
Hahaha, no problem - but if I remember correctly, it was either Olaf or Koos who passed it on to you.
Sergio