Wednesday, 17 July 2013

How to check error's on K2 Black Pearl working in a SharePoint environment

When you deploy processes to K2 Black Pearl workflow server you can check process state as what stage it is on and if there's any error.

In order to view flow of process follow steps below,
  • Open Internet explorer on your K2 BP workflow server and navigate to this URL given below,

  • Make sure you use the right Server Name, once the page is loaded, click on Process Overview on left navigation as shown in picture below,

  • Now if you click on any process in Process Name column, it will take you to Process Instances window as shown in screenshot below. On this window you will be able to see some details about every single processes that has been initialized whether using ASP.NET application forms or a though a SharePoint web part. You are able to see who originated this process or if it's still running or complete.

  • If something go wrong then process instance will be in error state and it's process status will be "Error". You can view process flow by clicking on image within orange box in screenshot above. It will exactly show you place where process stopped. In K2 BP you can do Real Time Monitoring which isn't available in K2 2003 work-space. Real Time Monitoring will update process workflow without need of refreshing page again and again. Screenshot below showing example workflow,

  • If you want to see data related to process instance e.g. Data or XML fields then go back to previous page and click on it's Process's Folio e.g. Empty Folio in this case, you can set process instance's folio in process to be more specific e.g. have some title or id instead of Empty Folio. Clicking on process instance Folio will display further details e.g. Activity Name, Status, and then Duration which is a great feature for monitoring performance. An example screenshot is shown below,

  • Further clicking on Data in above screenshot will display data fields and there values, same with XML Data as it will display XML data that we may had used. Further clicking on Activity Name will display Event Name that are within that specific Activity. It will provide same details for events as we get for activities and an extra Destination which can be a role or activity.
  • K2 Black Pearl logs all errors that come up while running a process instance, you can view all processes errors by going to,

    >> Management ( Top Navigation Tab) >> Management Console >> K2 Black Pearl Server (Left Navigation Tab) >> WorkFlow Server >> Error Profiles >> All

  • You can also add new error profiles as if you have 10's of processes and you want to see errors related to a specific process only. Once you see the error, you can take steps you need to fix it.
  • After fixing the issue you can click on Retry to assume process from where it was stopped but sometimes you need to modify K2 black pearl process and redeploy it to see the changes. Check my blog post for how to deploy K2 BP process.
Note: Some of the screenshots used in this article has been picked up from Google search.

Thursday, 4 July 2013

Deploying K2 Black Pearl Project to INT or Production

Developing and deploying K2 black pearl on a development machine doesn't take a lot of effort but just few clicks, however when you want to deploy project to integration or production server you will need to create a deployment package. Once you get deployment project files you can use MSBUILD.exe to deploy it on Production server.

You can also deploy it remotely to production server as far as you are trying to deploy it within domain and port 5555 is enabled to communicate with other servers as other wise you will get connection refused or lost errors while deploying.

Follow steps below to create a package using Visual Studio 2010 and deploy it on Integration server with just K2 Black Pearl on it using MSBUILD,

  • Build your project so that you get the latest DLLs in your debug or release folder.

  • Right click on project and then click on "Create Deploy Package" as shown in picture below, you only get this option if you would had installed K2 BP extension for Visual Studio 2010.

  • Above steps will create a deployment package at directory,

    Directory To Your Project\Project Folder Name\Project Process Files\obj\Release
    //if your build is release then deployment project will be created or updated in release folder

  • Release folder has all the files you need for deployment so take it your K2 BP production server (with K2 BP already installed on it) and open Visual Studio command prompt or check this post out to see how to open VS command prompt.
  • Execute following commands one by one to deploy package to server,

    cd C:\Windows\Microsoft.NET\Framework\v2.0.50727

    MSBUILD "C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild" /p:Enivronment=INT

Now if you receive this error,

C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild(235,5): error : SmartObject Server Exception: Could not publish SmartObject Definition to server: Error refreshing Service Instance 'WorkflowReportingService'. Service returned : 'Workflow Reporting SO Service: MSDTC on
 server 'Database Server' is unavailable.
C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild(235,5): error : '.
C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild(235,5): error : . SmartObject: [My Project (20) Process Instances]
C:\Users\deploymentAccount\Desktop\Release\Deployment\myDeploymentFile.msbuild(235,5): error :
0 Warning(s)
1 Error(s)

Then remove following lines from file with MSBUILD extension in your deployment folder only if you didn't used smart objects,


In our environment, we are not using smart objects but while creating deployment package it just adds above lines and while deploying errors, so removing above lines result in successful deployment.