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,

    http://ServerName/workspace/Navigation/Navigation.aspx
  • 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,

Build FAILED.
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,

    <Create_Workflow_SmartObjects>True</Create_Workflow_SmartObjects>
    <Create_Workflow_Reporting_SmartObjects>True</Create_Workflow_Reporting_SmartObjects>

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.

Wednesday, 19 June 2013

Convert WSDL file to a C# class and then DLL


Today I was trying to update a web reference of custom web services in my project but because of some reason visual studio 2010 wasn't getting the latest methods I added even though I could see them using browser. Hence to get around problem I converted WSDL file into C# class and then into a dll.

You can target dll to any framework you would like. In order to get DLL in .Net 4.0 framework try following steps;

For getting you library dll in.Net 4.0 framework you will require Visual Studio 2010 tools installed on your machine, however for it in .Net 3.5 framework you will need Visual Studio 2008.


  1. Open Visual Studio Command prompt as a administrator by going to Start menu > All Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio Command Prompt (2010).
  2. Put your WSDL file in somewhere accessible e.g. in this case I will put it in my C drive and getting output CS class in C drive too but you can change it. Type this command and press okay,

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>wsdl /l:C# /out:C:\OutPutClassName.cs C:\myWebService.wsdl
  3. Above command will generate a CS class in your C drive, now if you want to convert this class into dll in .Net 4.0, type this command;

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>csc /target:library /r:System.Data.dll /r:System.Data.Services.Client.dll /out:C:\OutPutClassName.dll C:\OutPutClassName.cs

    Above command will get you class library dll in .Net 4.0 framework.
  4. In order to get ..Net 3.5 use this command,

    C:\Program Files\Microsoft Visual Studio 9.0\VC>csc /target:library /r:System.Data.dll  /out:C:\OutPutClassName.dll C:\OutPutClassName.cs
MSDN Reference: http://msdn.microsoft.com/en-us/library/bb332338.aspx#msdnwcfhc_topic6

Wednesday, 5 June 2013

Right way of installing assembly into GAC in Windows Server 2012


In previous version's of Windows Server we were able to simply drag and drop assemblies into GAC folder which wasn't recommended at all, however being in a development environment (Windows Server 2012) when I tried to drag and drop a DLL into GAC, I received this error,




Now if you want to install assembly to GAC following steps,

  1. Assuming you are new to Windows Server 2012, Move your mouse pointer to right bottom of your screen just next to Date & Time.
  2. Click on "Search" tile.
  3. Now enter "cmd" in search text box.
  4. Most likely you will see two apps named as "Command Prompt" and "Visual Studio Command Promp...".
  5. If you will right click on "Visual Studio Command Promp.." it will give you few options at bottom of screen as show in picture below,






  6. Click on "Run as administrator" and press "Yes" for typical dialogue appears each time you try to start       a processes as administrator as security confirmation.
  7. Now type down this command,

    cd C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
  8. Copy your assembly to folder directory,

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
  9. Once assembly is copied you can use following syntax to install assembly to GAC,

    gacutil /i mySolution.myProject.dll
    an IIS reset will be produced as a result of above command so be careful as if you might break any on going process

That's it. Your assembly is installed, you can follow the procedure as many times as you want.

For more information please check this MSDN link out: http://msdn.microsoft.com/en-us/library/ex0ss12c(v=vs.80).aspx

Tuesday, 28 May 2013

SQL Sever 2008 R2 has an unsupported version error in SharePoint product configuration wizard


I was trying to create a SharePoint 2013 development VM and came across this nasty error,

SQL server at "SQLSERVERNAME" has an unsupported version at "xxx.xxx.x.x" (IP address). Please refer to http://technet.microsoft.com/library/cc262485(office.15)?ocid=fwlink#section5 for more information on the minimum required SQL Server Versions and how to download them.






I also tried PowerShell to create a configuration database but got same error,



PS C:\Users\Administrator> New-SpConfigurationDatabase
cmdlet New-SPConfigurationDatabase at command pipeline position 1
Supply values for the following parameters:
DatabaseName: SharePoint_Config
DatabaseServer: MSSQLSERVER
FarmCredentials
Passphrase: myPass



I fixed the error by installing update for SQL Server by Microsoft to make it work with SharePoint 2013. I downloaded Microsoft® SQL Server® 2008 R2 Service Pack 1 from http://www.microsoft.com/en-us/download/details.aspx?id=26727

Running this setup will update your SQL Server R2 to SP1 which is requirement for SharePoint 2013.



Upgrading your MCITP : SharePoint Administrator 2010 to SharePoint 2013 Solution Expert


If you already earned MCITP : SharePoint 2010 Administrator certification then you can easily upgrade it to SharePoint 2013 Solution Expert by passing 417, 331 and 332 exams, as shown in picture below,



Source : http://www.microsoft.com/learning/en/us/mcse-sharepoint-certification.aspx#fbid=MDgfOwqPuct?upgradeable

There isn't any upgrade path came out yet(28-05-2013) for MCPD : SharePoint 2010 Professional developers to upgrade and get certified in SharePoint 2013.

Thursday, 23 May 2013

Capturing iPad or iPhone traffic using Fiddler2

Recently I have been given a task to find out why iPad application isn't getting the "correct" data from our SharePoint environment. I don't know much about how iPad has been developed but I been told it's consuming custom web services. Hence I downloaded Fiddler2 to analyse iPad traffic and see what has been requested by iPad and what is it getting in return.

Once you downloaded Fiddler2 on your computer, you can add proxy details to your iPad as shown in picture below,




Enter IP address of your computer in front of Server Make sure your port number matches one on Fiddler2 by default it's "8888". You can change default port by going to Tools > Fiddler Options > Connections > Fiddler listens on port:  as shown in picture below,




Now if you also want to capture HTTPS (secured) traffic then check boxes as shown in picture below,




Next step would be clicking on "Export Root Certificate to Desktop" and sending certificate you just exported on desktop to your iPad through email. Once you received it on your iPad just try opening the certificate and install it.

That's it, you can start capturing traffic now, one thing I would like to mention is that my iPad and Computer has been connected to same intranet network while I was debugging.