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
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