Tag Archives: K2 for SharePoint

Configure K2 and SharePoint Online integration

Some time ago I posted an article “Configure K2 and SharePoint Online integration” on StarWind Software blog which outlines details about getting your SharePoint online instance up and running and adding K2 for SharePoint app to your app catalog, so if you are interested to know more read on at StarWind Software blog.

One thing I was not 100% clear on while writing that article is “Enable auto-activation on sites where the app is deployed” option, which is enabled by default (K2 for SharePoint app > Settings > Manage App Activations).

Based on the setting name wording I was not very clear whether “Enable auto-activation on sites where the app is deployed” setting works for SharePoint online newly created site collections? Especially as I’ve noticed that if I run activation manually there is a step “we need to create a token of your behalf” which, I assume, requires user input… So I had a question whether auto activation is possible for SharePoint Online newly created site collections where K2 app was only deployed?

It was also not very clear what drives/triggers automatic activation and with which frequency it happens.

Luckily enough there are some colleagues who always help 🙂 Below some extra details I’ve learnt only after writing that article.

The function of the Auto-Activation Setting on the Manage App Activation Page designed for strict activation on Site Collection Level (permission wise) and only allow Site Collections to be activated via the App Catalog Level.

When the setting is set to False the below Warning will be presented when the user tries to activate on the Site Collection Level:

This setting will not Auto Activate any new Site Collections created in SharePoint Online. When it set to True/Enabled you can perform activation from site collection level. So the wording “Enable auto-activation on sites where the app is deployed” is really a bit confusing though description above this setting is quite clear (but who reads notes and descriptions? 😉

Essentially this option allows Site Collection Owners activate K2 app on a site collection level manually and when it disabled they won’t be able to do that from the site collection level and it will be possible only via app catalog level from K2 app management page.

But, true auto activation does happen for sub-sites of already activated site collections. But this functionality works only with K2 Five. This functionality was introduced in K2 4.7 but did not work as expected. More information on this can be found in the following KB http://help.k2.com/kb001755

But this subsites auto-activation requires Event Receiver sub-site of the K2 site to be exposed to internet when you use SharePoint Online. When using SharePoint on premise there is no need for any exposure of the K2 site to the internet.


Unable to activate/uninstall K2 App: RemoveApp does not exist as a method of this SmartObject Instance

Sometimes when trying to activate or uninstall K2 4.7 App from App Catalog level or from the Site Collection level you can get the following error:

If you enable SmO logging you can trace that error actually happens on SmO level, more specifically with SharePoint Integration Helper Methods SmO and its Activate Site Collection method:

 System > SharePoint 2013 Integration > SharePoint Integration Helper Methods

*NOTE: Issue happens with Activate Site Collection method, not with Activate Site Collections one.

Sometimes clearing your browser’s cookies and cache or starting your browser using another user account or incognito / InPrivate mode helps to resolve this issue. But when those methods does not work  you may try to execute this method manually in the SmO Tester tool using K2 service account. The only required input property which you need is the SiteURL, the rest of the fields can be blank. This action should result in an output message “Success”. Once that’s done, you can go back to your SharePoint AppCatalog and Activate or Uninstall the K2 App from there – this time it should not give you any errors.


Removing K2 for SharePoint app

It has been a while since my last K2 realted post, but it is not because there is nothing to write about, it is just a bit difficult to allocate a time slot for writing. Honestly, with K2 set of technologies you not only have “marketing” promise of BYOA but indeed you do can create your own K2-based app fast and with very gentle learning curve, but at the same time when your work is to help various people on the different points of their “gentle learning curve” with K2, then this platform can give you a ride on a quite steep learning curve 🙂 I mean there is ton of stuff to learn with array of use cases, design options and integration capabilities, sort of “fasten your belts” we going to move quickly type of scenario 🙂

One of the basic things which seems to be constant cause of confusion and support cases is related with correct uninstallation of K2 for SharePoint app from SharePoint 2013. Don’t get me wrong installation is important too, but once you installed app and started to create artifacts there are extra things to care about when you do need to uninstall your app for one or another reason. But let me elaborate on this and some related points in the following paragraphs.

First things first. SharePoint 2013 is different in terms of app development options, so K2 integration with SharePoint 2013 is also differs from what you have for SharePoint 2010. Important things there that now you have to deploy K2 for SharePoint app in your SharePoint 2013 site and all the management of K2 artifacts happens within SharePoint interface by means of pervasive K2 Application button readily available for you on ribbon:

Pervasive Application Button

This is your primary way of creating and deleting K2 artifacts in SharePoint 2013. Process of creating K2 artifacts in SharePoint 2013 called “appifying“: you use K2 application against SharePoint items to appify them. So here you have 3 key terms:

K2 artifacts – SharePoint 2013 based K2 SmartObjects. Appify (verb) – create SharePoint2013 SmartObject from SharePoint item (list, library etc.). And there is antonym of that, meaning that whatever you appified can be deappified.

So once you selected SharePoint 2013 item worth creating K2 SmartObject being used in K2 workflow you click on Application button and initiate appification process which looks approximately like this:



You may wonder why I dwell on such trivial things as this new terminology? Because I want you to be very clear on this specific point: Appification process do lead to creation of SmartObject which you will be able to see in Tester Tool but you SHOULD NEVER manage or delete SharePoint 2013 SmartObjects using Tester Tool, apart when you are in a mood for complex support case 🙂 Once again deleting/editing SP 2013 SI in tester tool is not supported and will furnish you with troubles you don’t want to have.

I hope that passage on terminology will help you to memorize this. Now to antonyms 🙂 Meaning why deappifying is important. As use of Tester Tool is not supported for managing SP 2013 service instance you have to deappify SharePoint items which had been exposed to K2 (read appified) before deleting such SharePoint items. If you fail to do this you will end up with such unwelcome guests as orphan SharePoint 2013 SmartObjects, which you don’t want to have in your environment. Deleting SharePoint item which had been appified? – De-appify it first! It is simple – click on that pervasive K2 Application button on a ribbon of object which you want to de-appify and delete created K2 artifacts:

Deappifying Single Item

Now to the topic of uninstall of K2 for SharePoint app from your SharePoint 2013 site. It should be clear by this point that it involves de-appifying off all appified items first. And knowing the way we treat documentation I will start from what not to do. Do not do this:

Wrong First Step

Now when you clear on what not to do, I can afford myself to add some details/explain why. Never do this Remove as a first step of K2 App uninstallation process unless you absolutely sure that no K2 artifacts have been created for this sate (nothing was appified) otherwise you will end up with orphan SmartObjects. Or to keep things simple never do this firs but learn correct process of removing K2 for SharePoint app which removes K2 artifacts (right order of steps is crucial here):

Step 1. Removing K2 artifacts from a SharePoint site. You can do this by means of Uninstall link under the General heading at K2 for SharePoint Settings page. To access K2 for SharePoint Settings page you either hover your mouse on K2 for SharePoint app icon and click on ellipses which appear in the top right corner of its tile, this will bring up pop out menu from which you have to click on SETTINGS (so 2 clicks involved here):

Accessing K2 for SharePoint Settings 1

One click method to access K2 for SharePoint Settings page is to click on K2 app logo/ inside of “black square”:

Accessing K2 for SharePoint Settings 2

From K2 for SharePoint Settings page you have to click on Uninstall link:


And as you can see from the warning you get this process will remove all K2 artifacts from the site:

Step 1 Uninstall

Step 2. Uninstalling the K2 for SharePoint components from the K2 environment. To accomplish this you run K2 for SharePoint Setup Manager from the Start menu and select the Remove K2 for SharePoint.

Important note: I recently noticed another point which confuses everybody – this uninstall process does remove K2 artifacts from SharePoint side but it still leaves them intact on K2 side:

“Removing K2 artifacts from a SharePoint site does not remove them from the K2 server, it does however remove the remote events which allow Workflows to start.”

This is by design to leave artifacts data on K2 side so that accidental deletion not entirely ruins workflows/forms/views and SmOs depending on those artifacts. I noticed that this really confuses people to see that artifacts still in place, for example in Tester Tool.

Why I describe this process in such details is because that Remove button unhappily filtered out in UI and it is very tempting to click on it 🙂 The problem is that it won’t remove K2 artifacts and if you subsequently remove appified SharePoint items (there will be no way of deappifying them) you will end up with orhpan SmartObjects in your environment.

And of course it is documented nicely by K2 – Uninstall is described in Maintenance section of K2 for SharePoint Installation and Configuration Guide. But not all useful things filtered out as well as some dangerous UI buttons at times. So I hope these explanations may help at least someone / bring couple of little points to your attention before you run into issue/log a support case because of not doing your K2 for SharePoint app uninstall properly or because of plainly deleting appifyed SharePoint items without deappifying them first.

Of course there is more in-depth things to learn about integration between K2 and SharePoint. For example you may start from KB001707 K2 for SharePoint Component Compatibility and it is only beginning if you want to dive in into technical details, but as usual worth of investing your time before you invested heavily in building your solution without doing your homework on compatibility and supportability.