Welcome to K2 Underground Sign In | Join | Help

So some time ago I promised a series on integrating K2 blackpearl with Microsoft Dynamics CRM 4, well here it is. This series of posts will discuss a number of ways in which you can integrate Dynamics CRM 4 with K2 blackpearl enabling you to rapidly build process-driven applications that span the organisation, its people, its services, its information and systems.

This series of posts is a work in progress and by no means a "definitive guide" on the subject. The idea of these posts is to begin by simply implementing a point style solution and hopefully over time evolve these into a more robust, repeatable framework (fingers crossed).

Some of the key questions I'll be looking to answer during this series include:

* How do you start a K2 process from within Dynamics CRM 4?

* How do you access a K2 tasks in Dynamics CRM 4?

* How do you use the Dynamics CRM 4 interface for a client events?

* Can I view the View Flow diagram from within a Dynamics CRM 4 user interface?

* How do you action a worklist item from within a Dynamics CRM 4?

* How do I get access to Dynamics CRM 4 entity data in K2 blackpearl processes & K2 SmartObjects?

To address these questions the agenda as it stands at the moment is as follows:

Chapter 1 - Initiating K2 blackpearl Processes

Chapter 2 - Leveraging the CRM UI for Client Events

Chapter 3 - Exposing Actions in CRM forms

Chapter 4 - Completing Client Events in CRM forms

Chapter 5 - Exposing the K2 blackpearl Worklist

... and more to come.

Dynamics CRM 4 Service Broker - Alpha

Together with Seb, I have been working on developing a Dynamic CRM 4 Service Broker to expose the CRM 4 entity model in K2 blackpearl and thereby allowing you to create K2 SmartObjects on top of that. This has been a side project of mine for some time and in an effort speed up its development and generally improve the quality of the end result I will be releasing the source code to the community via K2 Underground in the next couple of days. 

I look forward to all the CRM 4 experts that I know we have in the K2 Community contributing to this and making it a key K2 blackpearl asset. If you'd like to contribute or have any feedback then please get in touch with me through K2 Underground.

CRM Object Browser 

UPDATED: The Dynamics CRM 4 Service Broker source code can now be found on K2 blackmarket.  

 

 


K2 blackpearl™, the centerpiece of the new K2 platform, has the K2 blackpearl 0807 (4.8210.1.0) release now available.


The 0807 release focused on greater stability and better performance than ever before. It includes various enhancements and performance increases for the K2 Workspace, the K2 Designer for Microsoft Visual Studio 2005, and the K2 blackpearl Workflow Server to name but a few. It also includes post-0803 patches and bug fixes. New exciting features included in this release are Out of Office functionality and K2 Interop!


OUT OF OFFICE
The K2 Out of Office feature enables a user to share specific worklist items or their entire worklist with other users. The user, the out of office participant, will be able to share current and future work items with designated colleagues, and redirect all remaining items to others by creating exception rules. The additional column on the K2 Worklist allows users to differentiate between their own and the absent colleague's worklist items. This functionality ensures that important and urgent work items receive prompt attention, regardless of someone being away from their desk.


K2 INTEROP (Moving Process Definitions from K2.net 2003 to K2 blackpearl – CLIENT SIDE)
K2 Interop (short for interoperability) is the ability for K2.net 2003 process (.kpr) files to be opened in the K2 Designer for Visual Studio that ships with K2 blackpearl. It is a client-side, design-time functionality that allows converted K2.net 2003 and hybrid (K2.net 2003 and blackpearl) processes to be deployed to K2 blackpearl. With the release of K2 blackpearl, organizations with an investment in K2.net 2003 may want to leverage the advantages of the new platform and migrate their existing business processes from the old platform to the new. From a technology perspective, K2.net 2003 is distinctively different to K2 blackpearl, and K2 blackpearl offers a whole new feature set however still supporting the same K2.net 2003 features moving forward. As a result the divide between K2 blackpearl and K2.net 2003 is bridged by supporting K2.net 2003 features within the K2 blackpearl environment using K2 Interop

MIGRATION (Moving existing K2.net 2003 Process Instances to K2 blackpearl – SERVER SIDE)
K2 blackpearl 0807 is now migration-ready. The migration utility will be released in the next few weeks and is NOT available immediately. It is important to note that you will require K2 blackpearl 0807 to use the Migration Utility. The Migration capability should not be confused with K2 Interop. Migration is the physical migration of data from K2.net 2003 to K2 blackpearl. This is a server-side, runtime functionality enabled by a separate utility that migrates database records from K2.net 2003 to K2 blackpearl.


NEW ACTIVE DIRECTORY SERVICE

The New Active Directory Service provides new objects and methods to access information from Active Directory for easy access and use of information to help create business processes and workflows in K2 blackpearl. This service surfaces information from AD and has a great number of performance enhancements and added functionality along with the functionality contained in the original Service, however it does not replace the original one.


PERFORMANCE ENHANCEMENTS
Numerous performance enhancements have been implemented. Some of the highlights are as follows. Workflow Server Performance

> Improved processes execution
> Worklist & Worklist Item performance
> Worklist enhanced paging and filtering capabilities
> More granular selection on Workflow Reporting SmartObjects
> Improved memory usage on K2 Designer for Visual Studio
> Improved memory usage when starting processes and finishing work list items
> Improved batch execution of K2 processes
> SmartObject Performance (runtime execution)
> SmartObject Server data handling enhancements

ENHANCEMENTS ON K2 WIZARDS
Some changes have been made to the functionality which resides behind the scenes of the K2 Wizards – specifically the items used for Microsoft SharePoint Server integration. These wizards now leave a smaller footprint on the process definition (.kprx) files, resulting in smaller file sizes and better memory management in the different designers available for K2 blackpearl.


DOCUMENTATION

Several additions and enhancements have been made to the K2 blackpearl Documentation. The key areas of improvement are as follows.


OVERALL DOCUMENTATION

Certain topics of the K2 blackpearl documentation has been updated and new topics added. New or updated topics are marked with an asterisk image in the Table of Contents

The following sections contain new or updated information:

> K2 Concepts - Content Fields
> K2 Wizards - Chaining wizards
          > Mail Event
          > IPC Event
          > SharePoint Records Management Wizard
          > Deploy Project Wizard
> K2 SmartObject Integration - SmartObject Association
> K2 for Visual Studio - K2 Design Canvas
> K2 Interop
> K2 Workspace - Management Console
          > Out of Office
          > Standard Reports
          > User Preference
> K2 Developer Reference - Architecture of K2 Platform
          > Users
> Extending the K2 Platform

Please take the time to review the latest K2 blackpearl 0807 (4.8210.1.0) Release Notes and product documentation before installing 0807 to ensure you understand the enhancements, fixed issues, and outstanding known issues.

For installation, we urge you to look at the Release Notes prior to Installation! There are two issues that you should be aware of before installing 0807 that may, depending on your current blackpearl installation, overwrite custom configurations.


DOWNLOAD K2 [BLACKPEARL] 0807 (4.8210.1.0)
K2 [blackpearl] 0807 (4.8210.1.0) is available at https://portal.k2workflow.com/downloads/bp/Default.aspx.
License keys can be obtained at
https://portal.k2workflow.com/licensekey/Default.aspx.

The page can also be found via the Support > License Key Request > License Key menu on portal. The 0807 installer is slipstreamed, so if K2 blackpearl is not already present, the installer will install K2 blackpearl with the 0807 updates.


SUPPORT
Please use the customer portal to open support tickets and/or contact your local support offices to report any issues. Additionally, the K2 blackpearl public forum on K2 Underground is available for community-based discussions: http://k2underground.com/forums/ default.aspx?GroupID=21. Note: K2 Underground is a community Web site and should not be used for production support issues or for logging bugs.

Sometimes in InfoPath Forms Server when submitting your form you will get an irritating information box which comes up and says: You have made changes to the form that have not been processed. We will process the changes and show the form again. After that you have to click "Submit" again.

You then have to click ‘Submit’ again for the form to submit .

To get rid of this message, and I know you want to, do the following:

  • Go to menu item ‘Tools’ then select 'Form Options'. Select on the list on the left 'Compatibility'.
  • Select the option to 'Design a form template that can be opened in a browser or InfoPath'
  • Now go to your form, select the control that is causing the problem. Right click on it and select 'Properties'
  • Go to tab 'Browser Forms' and change Post Back Settings to 'Always'. Note this tab would not have been here had we not changed the Compatibility options. 

I am sure this will help someone someday :)


This is one way to do it, which will add a menu item to the left hand side of CRM4.0 for CRM users to access their K2 Worklist.

Step 1 - Create a web application pointing to your K2 worklist.

Firstly, create a web page that will display the worklist using the K2 API (contact your K2 partner or consultant for the code on how to do this). I normally just make a virtual directory under 'Default Web Site' in IIS an point it to the files with the worklist page. Don't forget to disable 'Enable Anonymous Access' and enable 'Integrated Windows Authentication'.


Step 2 - Add icons to CRM
Add some nice looking icons into the CRM _imgs folder. You will need a big Big Icon and a  Small Icon small version. Feel free to use these ones as they fit perfectly into the CRM file structure. The _imgs folder is usually found in C:\Program Files\Microsoft Dynamics CRM Server\CRMWeb\_imgs  Note: Your file path could be different

Step 3 - Export the SiteMap.xml

In CRM4.0 click on Settings/Customizations - Export Customizations
Select 'Site Map' and click 'Export Selected Customizations'


Step 4 - Edit the customizations.xml

Add the following code to where you want the K2 Menu item to appear on the left. Note, I have a web page pointing to my worklist
at http://localhost/Worklist/Default.aspx, your URL may be different.


<Area Id="K2" Title="K2" Icon="/_imgs/K2_28.png" >
 <Group Id="K2">
  <SubArea Id="K2Worklist" Url="http://localhost/Worklist/Default.aspx" Icon="/_imgs/K2_16.png" Title="K2   Worklist" />
 </Group>
</Area>

Step 5 - Import the customization.xml changes

In CRM4.0 click on Settings/Customizations - Import Customizations
Browse to your Customizations.xml file and press 'Upload'
Select Site Map and click 'Import Selected Cusomizations'

Finally

Close and Open CRM4.0 and you should see your new menu item with the worklist. Hopefully it looks something like the below image.

K2 Worklist in CRM4.0

 

There are many ways to connect to the K2 Server which all vary depending on what you want to do. I found myself in a situation where I need to create a connection as a particular user and the usual way to connect to the K2 Server (as seen at the end of this post) was giving authentication issues. Remember, I am talking about making a connection to the K2 Server (default port 5252) and NOT the SmartObject server (default port 5555).

Here is the good way to connect that worked:

ConnectionSetup consetup = new ConnectionSetup();

consetup.ConnectionString = "DOMAIN,USER,PASSWORD";

conn.Open(consetup);

 

I dug around on the K2 Underground and found some addition code around the ConnectionSetup object for alternative ways to connect to the K2 Server, and found the following:

 

using (Connection K2Con = new Connection())
{
    ConnectionSetup K2ConSetup = new ConnectionSetup()

    K2ConSetup.ConnectionParameters.Add(
ConnectionSetup.ParamKeys.Host, ConfigurationManager.AppSettings["K2Server"]);

    K2ConSetup.ConnectionParameters.Add(ConnectionSetup.ParamKeys.TimeOut,  ConfigurationManager.AppSettings["K2ConnTimeOut"]);

    //Open a connection to the K2[blackpearl] server

    K2Con.Open(K2ConSetup);
    K2Con.ImpersonateUser(Profile.GetValue(
"WindowsLogin"));
    nameLabel.Text = K2Con.User.Name;

    Worklist K2WorkList = K2Con.OpenWorklist("ASP");

    K2Con.RevertUser();

    ... more code

    K2Con.Close()

}

Other connection options include:

SourceCode.Workflow.Client.Connection conn = new SourceCode.Workflow.Client.Connection();
conn.Open("[HOST]");

//or if you wish to open the connection as a specfic user replace conn.Open("[HOST]") with:

conn.Open("[HOST]", "[DOMAIN], [USER], [PASSWORD");

I am confident that using one of the methods above you will successfully be able to connect to the K2 Server.

 

 

Here are some pointers when using the Connection object. This object is part of the BaseAPI from which each API inherit (SmartObjectClientServer, SmartObjectManagementServer etc).

 

Below is some sample code based on three scenarios in which you can connect to the server from the API.

 

1.       Scenario 1: Opening and closing multiple connections

a.       This is the most expensive way of using connections and causes the most overhead. Reason being that after each Open method on the connection object, the call is authenticated on the server and this is what cause the most overhead. This scenario is typically used in a stateless environment where user context does not exit between method calls for example web apps with no sessions.

 

            SmartObjectManagementServer _mgmtServer = new SmartObjectManagementServer();

            SmartObjectClientServer _clientServer = new SmartObjectClientServer();

 

            string _conString = "Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=blackpearl;Port=5555";

 

            SCConnectionStringBuilder _connBuilder = new SCConnectionStringBuilder(_conString);

 

            #region Scenario 1 - Connection for Each operation

 

            //Get SmartObject List...

            _mgmtServer.CreateConnection(_connBuilder.ToString());

            _mgmtServer.Connection.Open(_connBuilder.ToString());

            SmartObjectExplorer smoExplorer = _mgmtServer.GetSmartObjects(SmartObjectInfoType.System);

            _mgmtServer.Connection.Close();

 

 

            if (_clientServer.Connection == null)

                _clientServer.CreateConnection();

            _clientServer.Connection.Open(_connBuilder.ToString());

            SmartObject smo = _clientServer.GetSmartObject(smoExplorer.SmartObjects["UMUser"].Guid);

            _clientServer.Connection.Close();

 

            if (_clientServer.Connection == null)

                _clientServer.CreateConnection();

 

            smo.MethodToExecute = "Get_Users";

            smo.ListMethods[smo.MethodToExecute].Parameters["Label_Name"].Value = "k2";

 

            _clientServer.Connection.Open(_connBuilder.ToString());

            SmartObjectList userList = _clientServer.ExecuteList(smo);

            _clientServer.Connection.Close();

 

            #endregion

 

2.       Scenario 2 : One connection performing many operations.

a.       This is a much more efficient way of using connections. You can share the connection object between API’s thereby making it easier to manage the connection.

 

            SmartObjectManagementServer _mgmtServer = new SmartObjectManagementServer();

            SmartObjectClientServer _clientServer = new SmartObjectClientServer();

 

            string _conString = "Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=blackpearl;Port=5555";

 

            SCConnectionStringBuilder _connBuilder = new SCConnectionStringBuilder(_conString);

 

            _mgmtServer.CreateConnection();

            _clientServer.Connection = _mgmtServer.Connection;

 

            _mgmtServer.Connection.Open(_connBuilder.ToString());

            SmartObjectExplorer smoExplorer = _mgmtServer.GetSmartObjects(SmartObjectInfoType.System);

            SmartObject smo = _clientServer.GetSmartObject(smoExplorer.SmartObjects["UMUser"].Guid);

            smo.MethodToExecute = "Get_Users";

            smo.ListMethods[smo.MethodToExecute].Parameters["Label_Name"].Value = "k2";

            SmartObjectList userList = _clientServer.ExecuteList(smo);

 

            _mgmtServer.Connection.Close();

 

3.       Scenario 3: Using sessions.

a.       If your calling client has state and can manage sessions, this is the way to use it with the connection object. The session connection timeout on the server can be set. It does however apply  to the entire server which means all servers hosted on that server. The default time is 20 minutes. If a session times out and you make a API call without Authenticating (Authenticate=true) you will get an exception.

b.      This is the most efficient way of handling connections, providing you have session state.

 

SmartObjectManagementServer _mgmtServer = new SmartObjectManagementServer();

            SmartObjectClientServer _clientServer = new SmartObjectClientServer();

 

            string _conString = "Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=blackpearl;Port=5555";

 

            SCConnectionStringBuilder _connBuilder = new SCConnectionStringBuilder(_conString);

 

            _mgmtServer.CreateConnection();

            _clientServer.Connection = _mgmtServer.Connection;

 

            _mgmtServer.Connection.Open(_connBuilder.ToString());

            string sessionID = _mgmtServer.Connection.GetResumableSessionCookie();

 

            SmartObjectExplorer smoExplorer = _mgmtServer.GetSmartObjects(SmartObjectInfoType.System);

            _mgmtServer.Connection.Close();

 

            //Time elapse...

 

            SmartObject smo = null;

            try

            {

                _connBuilder.Authenticate = false;

                _clientServer.Connection.Open(_connBuilder.ToString());

                _clientServer.Connection.ResumeSession(sessionID);

                smo = _clientServer.GetSmartObject(smoExplorer.SmartObjects["UMUser"].Guid);

                _clientServer.Connection.Close();

            }

            catch (Exception ex)

            {

                Console.WriteLine(ex.Message);

            }

 

            //Some more time elapse...

 

            if (smo != null)

            {

                SmartObjectList userList;

                try

                {

                    smo.MethodToExecute = "Get_Users";

                    smo.ListMethods[smo.MethodToExecute].Parameters["Label_Name"].Value = "k2";

                    _clientServer.Connection.Open(_connBuilder.ToString());

                    userList = _clientServer.ExecuteList(smo);

                    _clientServer.Connection.EndSession(sessionID);

                    _clientServer.Connection.Close();

                }

                catch (Exception ex)

                {

                    Console.WriteLine(ex.Message);

                }

            }

 

Happy blackpearling!

Yes this is possible and very easy to do in fact. All you need to do is register a custom CRM plugin, pass some information to K2 and you are good to go. How you extend it is up to you, read below.

It essentially allows you to start K2 processes from CRM4.0 workflows on any CRM4.0 entity event i.e entity create, entity field update. Very cool indeed. I can't take the credit for this as the idea came from an awesome blog post which was given to me by our partner Ciber UK.

The plugin will be made available with full instructions and nice demo video to show you how it can be used in the K2 blackmarket shortly.

Hope you guys find some use for it.

Introduction

Many of our K2 blackpearl processes involve working with MS Word documents and also document libraries in MOSS 2007. Up until now it has been a rather fiddly task to extract data from MS Word documents and use that data in our K2 blackpearl processes.

Fortunately, MS Word 2007 uses a file format called Office Open XML which is an XML-based structure that makes extracting data relatively easy compared to previous versions of MS Word.

This post looks at how you can use the features of MS Word 2007 and a little bit of code (see sample below) to extract data from an MS Word document and assign it to process datafields in a K2 blackpearl process.

Preparing the MS Word 2007 Document

The first step in this project is to prepare the document - we shall do this by adding a new table cell to the document and assigning bookmarks and properties to the document.

The screenshots below walk us through this stage.

1. Step One - Add New Table Cell

The table cell is where we are going to type in our data and later use it in the process. The feature you need to use to insert a table into a document is found on the "Insert" tab of the "ribbon" in MS Word 2007. A bit basic I know but just in case no-one's ever done this before :)

2. Step Two - Select the Cell

Once you've added a new cell to your table, put the cursor into the cell and then select the "Select Cell" option from the "Select" menu which is located on the "Layout" tab of the ribbon.

The screenshot below shows you how to select a table cell in MS Word 2007.

Select Cell

 

Step 3 - Add a Bookmark

Once we've selected our table cell we need to create a new bookmark which points to this cell. To create a new bookmark jump to the "Insert" tab on the ribbon and select the "Bookmark" option from within the "Links" section which is located in the middle of the ribbon.

Selecting the "Bookmark" option will cause the bookmark dialog box to open.

Type in a value, in this case I'm using "ApplicantName" for the name of my bookmark. We'll use the bookmark later on when we create our document properties. Once you've typed in the name of the bookmark just click the "Add" button and you're done with this step.

Bookmark

Step 4 - Add a New Property - Part One

Now that we've added our bookmark to the table cell we need to create a new property in the document. MS Word 2007 is based on the Office Open XML format and any properties we set on the document are stored within the document's XML structure.

First jump to the "Properties" menu item and select it. This will cause a new menu "Document Properties" to appear just beneath the ribbon.

The screenshot below shows you how to jump to the "Properties" menu item.

. Document Property

When the "Document Properties" menu appears select the "Advanced Properties" option. This will cause the document "Properties" dialog box to appear.

Advanced Properties

Step 5 - Add a New Property - Part Two

Now that we've navigated to the "Properties" dialog box we need to jump to the custom tab in the dialog box. From here we will add a new property to the document itself.

Type in a value for the name of your new property, in this case I'm using "ApplicantName" for the name of my new property. The screenshot below shows how to do this.

New Property

Step 6 - Add a New Property - Part Three 

Once we've created a new property we need to link it to the bookmark that we created in a previous step.

To do this, check the "Link to content" checkbox and then select a value from the "Source" drop-list - this drop-list contains a lookup to all of the bookmarks for the document.

You should see the name of the bookmark that you created in a previous step. Select the bookmark you want to link your property to and once you've done that click the "Add" button.

The screenshot below shows how to do this.

Link to Bookmark

Next click "OK" and that's you done - you've successfully configured your document with a new property linked to a bookmark within a table cell. Later on, you can type data into this cell and whatever you type in will be extracted and used within the process. We'll talk about how that happens in the next section.

If you need to extract additional data from the document simply repeat the steps described above. 

Extracting the Data

In this section we'll look at how to extract the data from a document that has been prepared using the steps described above. Before we get to the code we'll first take a look at the process included in the sample project attached to this article.

1. Process Description

We start the process by uploading a document to a MOSS 2007 document library. From there the document is then downloaded (we use standard K2 blackpearl wizards to download the document) to a location on the file system.

The reason I chose to download the document to the file system was due to the fact that it made it easier to write some C# code to extract the data - feel free to play around with other methods of manipulating the document and see what you can come up with, I'm sure there are many other ways to do this!

Once the document is downloaded we can use some C# code to get at the data in the document XML and assign it to process data fields.

Steps One and Two below show this in more detail.

Step One - The Process

The screenshot below shows the process and you can see where we first download the document and then use a server (code) event to extract the data.

Process Designo

 

Step Two - The Code Listing

A section of the code is shown below.         {

            XmlDocument xmlProperties = new XmlDocument();

            using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(@"C:\XXX\Application.docx", false))

            {

                CustomFilePropertiesPart appPart = wordDoc.CustomFilePropertiesPart;

                xmlProperties.Load(appPart.GetStream());

            }

            XmlNodeList chars = xmlProperties.GetElementsByTagName("property");

            foreach (XmlNode var in chars)

            {

                if (var.Attributes["name"].InnerText == "ApplicantName")

                {

                    string ApplicantName = var.InnerText;

                    char[] myChar = {'.'};

                    K2.ProcessInstance.DataFields["ApplicantName"].Value = ApplicantName.TrimEnd(myChar);

                }

You'll see that I've hard-wired the path on the file system (where the document was downloaded to) and I've also hard-wired the document name. You can also use dynamic values here, possibly from a SmartObject or process data fields, as you prefer - you choose, it's your project!

If you do decide to download the file to the file system before parsing don't forget to write a bit of "clean up" code to delete the file once it's been parsed. 

 

Testing the Solution

Once you've got this far you're almost there. Deploy your process as normal and once you've set your process rights you can start the process off.

 

Further Reading

If you want to read more about Office Open XML then Microsoft have plenty of content on MSDN for you to explore.

Hope you've enjoyed this article - if you've any questions drop me a mail and I'll be happy to answer them.

Cheers and happy blackpearling..

Andy 

 

If you ever have issues logging on as a particular user into anothers users session on a VPC environment, you may need to tweek the Group Policy Log. This also follows on from my earlier post if you are having the irritating go.microsoft.com problem when going to a different users browser and don't get taken to their default home page.

To allow all domain users do the following:

  • Start/All Programs/Administrative Tools/Domain Controller Security Policy
  • Go go 'Local Policies' and expand it to see 'User Rights Assignment'
  • For the property 'Allow log on locally'  add to the users group 'Domain Users' and 'administrators'
  • Then go to start/run cmd (command line) and do a ... 'gpupdate'

Cheers
Nic

Creating an Employee SmartObject (SmO) is a great business entity to have available for any workflow application in a company. It is very easy to create a SmartObject in the K2 Studio SmO Editor and use the existing K2 Active Directory Service Object.
In 2 or 3 steps, you will be able to create the following SmO (for more details, please see the “SmartObject Integration >> Introduction to SmartObjects | SmartObject Properties Toolbar | SmartObject Method Wizard” topics in the “K2blackpearl.chm” file from your K2 Blackpearl 0803 documentation):
SmartObject Properties

Obviously, you can call your SmO objects methods into your process without writing any code, using the SmartObject Event to associate DataFields with SmO return Properties (for more details, please see the “SmartObject Integration >> K2 SmartObject Event Wizard” topic in the “K2blackpearl.chm” file), or to create some rules in your outcomes. In your .net forms, you can easily use the K2 blackpearl ADO.net Data Provider to request your SmO (for more details, please see the “K2 for Visual Studio >> The .NET Framework Data Provider for K2 SmartObjects” topic in the “K2blackpearl.chm” file) to create for example a DropDownList displaying employees.

Perhaps you do not want to use the ADO.net Data Provider ? Why not :-)… You have the ability to use the SmO API to call your methods. In this case, you need to be aware of a tricky behavior using the Active Directory Service Object: the Property Name visible on your SmartObject Editor isn’t the name you need to use with the API to get the value. This name is actually the display name, and you need to know the real name of the property and that name is the one used in the DirectoryServices namespace. The following sample code shows how to use the GetList SmO method with a filter on the Account Name, including the association between Display Name and Property Name:

 

    using SourceCode.Hosting.Client;

    using SourceCode.SmartObjects.Client;

    using SourceCode.SmartObjects.Client.Filters;

 

    public void getADSmOProp(string myFilterValue)

    {

        // Open a K2 Server connection

        SmartObjectClientServer SmOServer = new SmartObjectClientServer();

        SmOServer.CreateConnection();

        SmOServer.Connection.Open("<MyConnectionString>");

 

        // Get a handle to the ' MyADSmO' SmartObject

        SmartObject soEmployes = SmOServer.GetSmartObject("<MyADSmO>");

        // Specify which method will be called

        SmartListMethod getList = soEmployes.ListMethods["GetList"];

        soEmployes.MethodToExecute = getList.Name;

 

        // Setup the filter

        Contains myFilter = new Contains();

        myFilter.Left = new PropertyExpression("name", PropertyType.Text);

        myFilter.Right = new ValueExpression(myFilterValue, PropertyType.Text);

        getList.Filter = myFilter;

 

        // Call the method which will use the filter

        SmartObjectList soLEmployes = SmOServer.ExecuteList(soEmployes);

 

        string p = "";

        foreach (SmartObject smo in soLEmployes.SmartObjectsList)

        {

          //***** Properties to display

          // SmO Property - Account Name:

          p += smo.Properties["sAMAccountName"].Value;

          // SmO Property - User Friendly Name:

          p += smo.Properties["name"].Value;

          // SmO Property - Unique Name:

          p += smo.Properties["distinguishedName"].Value;

          // SmO Property - Active Directory Object Type:

          p += smo.Properties["objectClass"].Value;

          // SmO Property - Email:

          p += smo.Properties["mail"].Value;

          // SmO Property - Description:

          p += smo.Properties["description"].Value;

          // SmO Property - User Manager:

          p += smo.Properties["manager"].Value;

          // SmO Property - Domain Name:

          p += smo.Properties["domainname"].Value;

          // RMK: Friendly Name is in smo.Properties["<property>"].Metadata.DisplayName

        }

 

        // Close the connection

        SmOServer.Connection.Close();

    }

Important notice: K2 Labs are currently busy working on a new version of the AD Service, so this should be fixed in a next release K2 blackpearl 0806 with optimization of the AD tools.


-- by Jean Cadeau

The Management Console which is hosted inside the K2 blackpearl Workspace has a great new management feature where you can directly manage your K2 licenses :

  • Upgrade or update the license key (you no longer need to launch the Configuration Manager):

 

  • Managing licensed users (you can now view who is currently using a license and remove any users who have a license):


-- by Jean Cadeau

The K2 blackpearl server runs on 14 different databases. If you share your SQL Server instance with other pieces of software for example MOSS or SQL Server Reporting Services it will be better to prefix all K2 database names to easily be able to see which database belongs to which environment. This is now possible through the K2 [blackpearl] 0803 Configuration Manager.

During the installation you can change the database names as you can see below:


 
So, you can click on “change” for each Database and choose a new name (we strongly suggest to just add a prefix :-)) or move this database on another server:


 
After the installation has completed, you will find the following updated databases on your SQL Server instance:

 

As you can see, this obviously works with non English platform ;-)

-- by Jean Cadeau

Hi All 

 

I have found some material for you on the SharePoint limitations when hosting Workflow schedules.

 

Here is a comment I just received directly from George Hatoun, Lead program manager who drove the workflow implementation for MOSS

For example:

Let’s say I have one server scenario (to make it simple) and I have 15 running instances of document approval workflow across 3 libraries (5 per library).  Lets also say that the current status of each is “awaiting” approval. Does this imply the workflows are “not finished executing” and if I kick off a 16th workflow instance, nothing will happen, until one of the others has completed?

 When I wrote “finished executing”, I meant that it is no longer actively being processed by workflow engine on the front-end machine and consuming CPU. Well-written workflows awaiting approval or other user input would go “idle” and are immediately “dehydrated” (serialized) to disk by the SharePoint workflow host; we wake them up when an event they are subscribed to comes in.

 

They do not count towards the limit of 15 actively executing workflows. There is no hard limit on these, and the SharePoint workflow host is designed so that these workflows have little impact on the performance of the system apart from the storage they consume in the backend.

Here are some Blogs for you to look at around this issue:

 

http://geek.hubkey.com/2007/09/maximum-number-of-simultaneous.html

 

http://blogs.msdn.com/harsh/archive/2007/03/21/sharepoint-2007-maximum-limitations.aspx

 

Here is some other interesting reading:

 

http://www.sharepointblogs.com/llowevad/archive/2007/09/21/huge-workflow-issue-what-is-microsoft-thinking.aspx

 

http://k2underground.com/blogs/articles/archive/2007/07/11/to-moss-or-not-to-moss.aspx

The 0803 release for K2[blackpearl] has been announced. This release provides support for 64-bit hardware platforms, support for Worldwide English (non-English Windows, SQL Server, SharePoint, Office and Visual Studio), improved license management, performance enhancements and post-SP1 patches and bug fixes.

64-BIT SUPPORT
64-bit support allows K2[blackpearl] components to be installed on 64-bit hardware platforms. Support for the 64-bit platform includes the following components.
    > 64-bit SQL Server 2005
    > 64-bit SQL Server 2005 Reporting Services
    > 64-bit SharePoint 2007 (WSS/MOSS/Forms Server)
    > 64-bit K2 [blackpearl] Server
    > 64-bit K2 Workspace

WORLDWIDE ENGLISH (INTERNATIONALIZATION)
Worldwide English support allows K2 [blackpearl] to run in English on non-English platforms. Support for non-English platforms includes the following components.
    >  Windows 2003 Server (Standard or better)
    >  SQL Server 2005
    >  SQL Server 2005 Reporting Services
    >  SharePoint 2007 (WSS/MOSS/Forms Server)
    >  Visual Studio 2005 (Professional or better)
    >  Visio 2007

LICENSE MANAGEMENT
The K2 license management feature adds the following capabilities.
    >  Add / Delete license
    >  Edit existing licenses
    >  Manage Logged in Users
    >  Manage License over usage

DISTRIBUTED INSTALLATION ENHANCEMENTS
The K2 Installation Manager and K2 Configuration Manager tools have been greatly enhanced to allow for greater flexibility and robustness when installing K2 [blackpearl] in distributed environments, including the following.
    >  Improved support for network load balanced web front ends in SharePoint farms
    >  Improved support for network load balanced K2 Workspace scenarios

PERFORMANCE ENHANCEMENTS
Numerous performance enhancements have been implemented. Some of the highlights are as follows.
    >  Workflow Server Performance
    >  Improved processes execution
    >  Worklist & Worklist Item performance
    >  Improved memory usage when starting processes and finishing work list items
    >  Improved batch execution of K2 processes
    >  SmartObject Performance
    >  SmartObject Server data handling enhancements
    >  Client Data Marshalling enhancement
    >  SmartObject Synchronization - see KB000250 - SmartObject GUID Synchronization

IPC EVENT
The following issues have been fixed relating to the IPC Event.
    >  Process Synchronization using Batch Actioning, IPC Sync Events, and Worklist Navigation
    >  Worklist Issues with Multiple Destinations, IPC Events and Dynamic Roles
    >  Not all processes in a solution are displayed when browsing for child processes in an IPC Event
        wizard
    >  When an activity contains an IPC event where the destination user is mapped to the child process and
        is used in a client event, both users are able to view the other user’s work items.

DOCUMENTATION
Several additions and enhancements have been made to the K2 blackpearl Documentation. The key areas of improvement are as follows:

1. OVERALL DOCUMENTATION
    >  Combined all documents to be linked from CHM file for easier discovery
    >  Added a “Send Feedback” link to all topics
    >  Added/Improved content for Troubleshooting, License Management, K2 Wizards, SmartObject
        (Delete), 2003 Interoperability and InfoPath Templates

2. GETTING STARTED GUIDE
The K2 [blackpearl] Getting Started Guide has been completely rewritten to provide clear concise information for planning and installation including the following.
    >  A Getting Started Checklist spreadsheet is embedded in the guide to help you plan, document and
        verify your K2 environment
    >  Software prerequisites list is provided by component and by role
    >  A new “Before you begin” section has been added that details steps for configuring DNS, Service
        Accounts, Permissions, NLB, SPNs, MSMQ and DTC
    >  Detailed information for installing in a distributed environment has been greatly enhanced
    >  New topics have been added to the Troubleshooting the Installation section

3. DEVELOPER REFERENCE (FORMERLY SDK)
The K2 [blackpearl] Developer Reference was introduced mid Q1 and has been updated with the following new content for 0803.
    >  Database Overview & Schemas
Architecture topics
    >  Architectural Overview of K2 [blackpearl]
    >  Architecture of Authoring, Management and Runtime aspects of the K2 platform
    >  Architecture of the Workflow Server
    >  Architecture of the SmartObject Server
    >  Architecture of the Event Bus
    >  Architecture of the Environment Library
    >  Architecture of the Workspace Management Console
New “How To” topics
    >  How to access and return information from the Global Worklist
    >  How to upload a file to a SmartObject
    >  How to add a 3rd-party event recorder to the K2 [blackpearl] Server
    >  How to create a custom MSBuild task to set rights on a process
    >  How to Generate a Report in PDF format

COMPATABILITY MATRIX
The K2 [blackpearl] Compatibility Matrix has been added to the customer portal at http://portal.k2workflow.com/help/k2blackpearl/k2bpmatrix.aspx.
Please take the time to review the latest K2 [blackpearl] 0803 (4.8075.1.0) Release Notes and product documentation before installing 0803 to ensure you understand the enhancements, fixed issues, and outstanding known issues.

DOWNLOAD K2 [BLACKPEARL] 0803 (4.8075.1.0)
K2 [blackpearl] 0803 (4.8075.1.0) is available at https://portal.k2workflow.com/downloads/bp/Default.aspx.
License keys can be obtained at https://portal.k2workflow.com/lice nsekey/Default.aspx.  The page can also be found via the Support > License Key Request > License Key menu on portal.
The 0803 installer is slipstreamed, so if K2 blackpearl is not already present, the installer will install K2 blackpearl with the 0803 updates.

SUPPORT
Please use the customer portal to open support tickets and/or contact your local support offices to report any issues. Additionally, the K2 blackpearl public forum on K2 Underground is available for community-based discussions: http://k2underground.com/forums/default.aspx?GroupID=21.  Note: K2 Underground is a community Web site and should not be used for production support issues or for logging bugs.

 

Posted