This article refers to legacy products, components or features. Therefore, the content in this article is offered "as is" and will no longer be updated. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.
It is possible to update the metadata of the Document Set and the metadata of the file in the Document Set in a SharePoint Library. This Knowledge Base article describes how to use the K2 Designer for SharePoint and K2 Studio to update these values.
We are using a scenario that is based on a K2 Designer for SharePoint process which is created on a SharePoint Library. A Document Set is manually created. A document is then uploaded to the SharePoint library, moved to the Document Set and the metadata of the document is subsequently updated. Follow the steps below to implement the scenario.
- Create a SharePoint Document Library and name the library Legal.
- Navigate to Site Actions>Site Settings>Site Collection Administration and select Site collection features.
- Activate the Document Sets feature.
- Now navigate to the Document Library settings of the Legal Document Library, click on Advanced Settings, select Yes to allow for management of content types as shown below and click OK.
- Scroll down to the Content Types section and click on Add from existing site content types.
- Select Document Set and click Add, then click OK.
- Go to the Legal Document Library and select the Documents tab at the top.
- Click the arrow next to New Document and select Document Set.
- Use Legal Documents as the name for the new Document Set. Click OK. The Document Set is created.
- Go to the Legal Document Library and create the following columns:
- Type of document (type text)
- Status (type text)
- Navigate to Site Actions>K2 Site Settings>SmartObject Management and select K2 SmartObject Site Lists and Libraries. Tick the box next to the Legal Document Library and click Create.
- Navigate to the Legal Document Library, open the K2 Designer for SharePoint and create a process that will move a document that is uploaded to the Legal Document Library to the Legal Documents Document Set. Use the Move Document event for this purpose. Select the Legal Documents Document Set in the Move Document wizard as shown below.
- Add another outcome to the activity and call it Update status.
- Drag the Update Document event onto the Outcome.
- Drag the Document Name from the Document Context, type Risk in the Type of document field and Archived in the Status field. Finish the wizard.
- Add another outcome to the process and drag a Placeholder event onto the outcome.
- The process should resemble the following:
- Save and deploy the process.
- Navigate to the Legal Document Library and upload a document.
- Type New in the Status field and click Save.
- Start the process by clicking on the arrow next to the document and select Workflows. Click on the process you created and click Start.
- Note the status of the item in the Legal Document Library
- Wait for the process to finish and go to the Legal Documents Document Set. Note the Risk and Archived entries.
The same scenario as above is used for the second example. In this example the metadata of the Document Set is updated using the SmartObject Event in K2 Studio.
- Create a K2 Studio process and drag the SmartObject Event onto the canvas.
- On the Event Name and SmartObject Method screen, click on the ellipsis next to SmartObject Method.
- Add the Update method of the Document Set as shown below:
- Complete the fields below:
- Content Type: Document Set
- Name: [Document Set Name]
- Specify values for any custom fields
- Finish the wizard.
- Save and deploy the process.
- Start an instance of the process in K2 Workspace.
- Note the change of the status column of the Document Set.
In order to complete this example in the K2 Designer for SharePoint, SmartObject Access needs to be configured on the Document Set in SharePoint.
- Navigate to Site Actions>K2 Site Settings>K2 Designer for SharePoint Management>Configure SmartObject Access.
- Click Add new item.
- Select the Document Set and click Next.
- Click Finish.
- Go to the Legal Document Library and start a new K2 Designer for SharePoint process.
- The SmartObject tab is added at the top and the Update Document Set methodis now available for use.
- Apply the same concept as in Example 2 above.