Skip to main content

We've experienced an issue with K2 workflow deployment process between environments, when we are using SharePoint 2013 Management smart objects and will appreciate your help in resolving our problem.

 

Scenario:

We have workflows which will consume a smart object from Management category scoped for your K2 app installation in SharePoint site collection.

All Smart Objects in Management (User, Group, List, Library, etc.) category for the site collection are auto-generated and usable on the fly. The problem is when you want to package your workflow and deployed on another environment/s, all references for example to the User Smart Object are hardcode for the source environment by guid and errors are raised. Notice that these smart objects cannot be packaged by the K2 Package and Deployment tool as they are auto-generated by K2 for the site collection on specific environment.

 

Sample:

We've reproduced the scenario with sample workflow with only one activity as follows:

  1. Workflow executes Get User method for User Smart Object from Management category in our site collection.
  2. Workflow is packaged and deployed on another K2/SharePoint environment/s with no errors.
  3. Workflow throws error that User smart object could not be found based on specific guid from the source site collection.

 

So we are looking for a way to fix this problem as in our project smart objects (User, Group, List, Library, etc.) from Management category will be used very frequently for at least 30 (30+) workflows.


13577iB254B0D632696C4D.png

Hi Ilker-OneBit

 

In fact you should be using Package and Deploy to move your solution between environments. P&D will allow you to configure the SharePoint smartobjects to use the correct service instance and service object before you deploy. 

 

Have a look at the following:

 

How to package and deploy K2 for SharePoint artifacts

SharePoint Application Lifecycle Management

 

The other option (not preferred or ideal) is to change the server that your K2 Studio/VS is connected to to the deployment environment/server, re-run all of your SharePoint integration components and event wizards and deploy directly to that environment.


Hello Andrew,

 

Yes, you are totally correct we use Package and Deployment tool for all smartobjects we've created, meaning lists and libraries, that's totally fine. The problem is with the smart objects that K2 generated for us when it is installed for the first time in the site collection. Every site collection where K2 app is installed will generate category Management with preconfigured smart objects for accessing Site Users, Site Groups so on. When you attempt to use these smartobjects in a workflow everything is fine working fine, but notice that all references are bind to the smart object guid, it is not related to the service instance.

 

But if you want to deploy to another environment with K2 and SharePoint, new Management category is created for the target site collection with totally different smartobjects(guids...). Notice that you can package everything you have from the source site collection, but nothing inside these Management category - managed only by K2 app.

 

So, generally the problem is that you can deploy everything in the context of smartobjects you've created, but this will not include smartobjects which are generated by K2 for the current/working site collection.

 

My opinion is that if these smart objects are managed and generated by K2  app for every site collection, why should be referenced by guid...Like I am expecting when I call User smart object in Site Collection A, when I deploy my solution to Site Collection B K2 should find User smart object right away...


Hi Ilker-OneBit

 

Package and Deploy will also allow you to deploy management smartobjects that are created by the K2 application. I doesn't matter if K2 created the smartobjects automatically or you did. Smartobjects are always tied to a service instance, and because the guids for these service instances are different in each SharePoint environment you must do some manual configuration when deploying.

 

As a an example, I created a workflow in Dev that uses the Group smartobject under the SharePoint 2013 Management node

 

16824iF6163D368324B22E.png


Hello Andrew,

Much thanks for the screenshots, changed the direction of my research.

Just to clear out what is really the problem:

We can't package smartobjects from Management category with K2 P&D, there is no smartobjects when you expand Management category.

 

So I spent some time troubleshooting the problem based on your screenshot. In our environments this is an issue and I think it globally related to the On-Premises integration with SharePoint 2013.

Steps to reproduce:

1. Create new site collection.

2. Install K2 app on root web of your site collection.

3. Try to package Management category with K2 P&D tool - when you try to expand Management category there will be no smartobjects.

Workaround:

1. Open SmartObject Service Tester.

2. Navigate to the Management category in your site collection node in SmartObject Explorer.

3. Right click on Management category and select "Remove SmartObjects from Category" - Yes->Yes.

4. Navigate to your site collection node in ServiceObject Explorer.

5. Right click and select "Generate SmartObjects" - do it twice, if smartobjects are not generated first time.

6. Try to package Management category with K2 P&D tool.

 

Currently, this is the only working workaround we have.

Test Environments:

K2 Partners VM - K2 4.6.9

K2 Partners VM - K2 upgraded to 4.6.10.0

2 x K2 VMs - installed by us with K2 4.6.10.0


Reply