Since the release of SharePoint 2013, K2 has modified some of their workflow events for working with Sharepoint documents. I was recently in a situation where I had to utilize a Sharepoint library in one of my workflows, and ran into an issue referencing the Sharepoint site in a workflow event. This blog post will go into that issue and its resolution.
I was using the Add Document Reference event in a workflow created in the K2 Designer. This event is used if you want to add a reference to a document in a Sharepoint library to your workflow so you can use it later in other events. The first page of the wizards asks for the Sharepoint site URL (this would be the site that is housing the library). I was working with the latest version of K2 Blackpearl in a K2-provisioned VM including many common software systems such as Sharepoint, Exchange, CRM, etc. I typed the URL of the default Sharepoint page (portal.denallix.com) and clicked the Refresh icon. A message box popped up stating, "The request failed with HTTP Status 404: Not Found."
My initial reaction was a bit of puzzlement, since I knew SharePoint was properly configured already, and I was able to browse to the site fine (as both an administrator and the K2 Service account). I wasn't able to find a solution on the web, so I sent a support ticket to K2. After some research, they found that the event doesn't work in the K2 Designer if the site URL referenced is a Sharepoint 2013 site - the event will work if you are using Sharepoint 2010. This issue is currently on their TFS worklist.
As a workaround, the kind folks at K2 told me to use K2 Studio instead. The K2 Studio app worked fine when using the document reference event (it's named a bit differently though). Then I found another problem with my setup - the site was tested fine, but no libraries were showing up in the list. To fix this, I had to create a SmartObject for the library I wanted to use:
- Browse to the library you want to use and select the Library tab at the top of the page.
- On the ribbon, look for a section titled K2 and in that section, click Application.
- The next screen should give you an option to create Data, Smartforms, Workflows, etc. Data is what we need and is selected by default. Click OK at the bottom of the page to finish.
Thought this info would be useful to others having the same problem. Hope this helps!