Reusing K2 for SharePoint Artifacts

You create a K2 for SharePoint application when you use the K2 Application wizard on a SharePoint list or library. When you start the application wizard, K2 creates a SmartObject for the list or library and gives you the choice of creating SmartForms, a workflow, and reports. The resulting collection of K2 artifacts (SmartObjects, SmartForms, workflows, and reports) form your application.

Many businesses have multiple lists and libraries created from templates or created as copies. You can reuse K2 for SharePoint artifacts for these types of lists and libraries. Reusing these artifacts allows you to appify (create a K2 application from) a list or library, and then use the SmartObject, SmartForms, or workflow re-use options to link the primary K2 artifacts to matching secondary lists and libraries.

For example, a Human Resources collection of employee lists (identical in structure) that contain the employees for each major region. Employees_US contains information on employees in the United States of America, Employees_EU for employees in the countries of the European Union, and Employees_APAC for employees in the countries of Asia Pacific. Creating a K2 application of the primary list, Employees_US (this choice is arbitrary as any of them can be the primary list since they all have the same columns) creates K2 artifacts that you and reuse with the other two lists. In this example, you create SmartForms and a workflow that starts when a new employee is added to the list.

  • You can use the SmartObject of the primary list in another SmartForm or workflow and configure the SmartObject reuse options to point to the secondary lists, Employees_EU and Employees_APAC.
  • You can run SmartObject methods to configure the reuse options of the SmartForm so that the view you see in SharePoint of Employees_EU and Employees_APAC is the one created as part of the K2 application.
  • You can run SmartObject methods to configure the reuse options of the workflow so that when adding new employees to the Employees_EU and Employees_APAC lists, the workflow defined during the creation of the K2 application starts.
See the following resources for more information:

Considerations

  • Create your K2 application on your SharePoint root list, then re-use those SmartObject methods to access your secondary lists on your sub sites.
  • The K2 App must be installed and activated on the site on which you create the primary K2 application.
  • You must activate K2 for SharePoint on site collections containing secondary lists and libraries before you can link them to primary lists and libraries.
  • Using a primary SmartObject method to access a secondary list only works on the same SharePoint Web Front-End (WFE), which can have multiple site collections with sub sites.
  • When you make changes to your primary list or library, you must re-appify it to update the associated SmartObject. Click the list or library menu and select the K2 Application icon. For more information see Changes to a SharePoint List or Document Library Structure
  • Any changes you make to the primary list or library must also be made to the matching secondary lists or libraries.
  • K2 for SharePoint artifact reuse only works for lists and libraries that are compatible with each other. The secondary list or library must have the same columns and column types as the primary list.
  • Reusing K2 for SharePoint application artifacts only works with SharePoint objects of the same type. You cannot appify a document library and reuse those artifacts with a list.
  • You cannot use Calendar lists with the K2 for SharePoint artifact reuse options. The Calendar list type does not include parameters used to link primary and secondary lists.
  • You cannot use lists or libraries with a lookup to a library with the K2 for SharePoint artifact reuse options.
  • When you attempt to create a K2 Application of a list or library that is linked to a primary list's K2 artifact, you see an error message stating "This list is re-using a K2 Application". You must remove the reuse links before you can appify the list or library. See Resetting the Secondary List or Library Links for the steps to detach the K2 Application from the secondary list or library.
  • For lists and libraries only appified with forms, if you change your primary list from using K2 forms back to using SharePoint forms, you can appify your secondary list or libraries without resettling the form links. See Working with SharePoint Forms for more information on using SharePoint forms.
  • You must refresh SmartObjects created before K2 Five Update 5.2 to enable the Site URL and List ID parameters.
  • You can start a workflow using SharePoint events without appifying the list or library.

Also, see Lifecycle management of SharePoint with K2 Integration for further information and considerations when making changes to existing lists and libraries.