Use the SmartObjects artifact to generate and manage SmartObjects.
Generate SmartObjects
Follow these steps to generate single or multiple SharePoint list or library SmartObjects for a site:
- Click on New from either the libraries or lists section.
- A list of SharePoint lists or libraries displays depending on which section you are working from. Select the items for SmartObjects to be created for by clicking the check-box in front of each item. Select the scope of these items. The scope can be changed per item at a later stage. The scope options are:
- This Site and all of its subsites - This option enables the use of the SmartObjects in a workflow designed in the K2 for SharePoint application from any list or library in the Site Collection including all of the sites subsites.
- List/Library - This option enables the use of the SmartObjects in a workflow designed in the K2 for SharePoint application only for the specific list or library.
- None - Selecting this option will prevent the use of the SmartObjects in a workflow designed in the K2 for SharePoint application.
- Click OK to generate the selected items as SmartObjects.
- The items selected will now be listed under the relevant sections indicating the scope per item.
- If you click on New again, only the items for which SmartObjects do not exist will display. You can select them to generate SmartObjects.
When generating SmartObjects based on SharePoint lists, the associated Attachments SmartObject will also be generated and displayed in the list of SmartObjects as per the image above.
Clicking OK or Cancel on the Manage SmartObjects Landing page after generating SmartObjects, will not influence the SmartObjects generated. It will only save or cancel changes made to the Scope of these SmartObjects.
Manage SmartObjects
To manage SmartObjects, click on the SmartObjects artifact from the K2 for SharePoint App Settings page.
The scope of SmartObjects can be changed from this page. The scope determines where the SmartObject is visible for workflows. The scope options are:
- This Site and all of its subsites - This option enables the use of SmartObjects in workflows designed any SharePoint list, library, or related subsites in the Site Collection.
- List/Library - This option enables the use of the SmartObjects in a workflow only for the specific SharePoint list or library.
- None - Selecting this option will prevent the use of the SmartObject in a workflow designed in the Application.
To change the scope per SmartObject, select a SmartObject and click Edit or double click the SmartObject. Click on the drop-down under scope and select the new scope for the SmartObject.
Click OK at the bottom of the page to finish editing the SmartObject's visibility settings.
Changes to the SmartObjects are saved at the time of making the change. Clicking Cancel on this page will not undo your changes.
Additional SmartObjects
The Additional SmartObjects section allows you to add or remove other SmartObjects so they are visible when designing a workflow. For example, if you have a SmartObject that exposes a SQL database, you must add the SmartObject to the Additional SmartObjects section before it is available in the workflow design tool. Note that any SmartObjects you add in the Additional section appear in the SmartObjects tab of the workflow designer for all workflows designed on the site.
To add SmartObjects, click on the Add button and then use the ellipsis button to browse for and select the SmartObject you want to expose in the workflow designer.
Additional SmartObjects can be removed either by selecting a SmartObject and clicking Remove option, or click Remove All to remove all the SmartObjects listed.