19. (Optional) Clean up your K2 environment by deleting the application artifacts
This optional step describes how you can clean your K2 environment by deleting the artifacts that you created in this tutorial. For example, if you are working in a shared environment, you may want to delete your tutorial applications to keep your environment clean and tidy.
Deleting artifacts (such as views, forms, SmartObjects, workflows, service instances and so on) removes them from the K2 server permanently and you cannot retrieve or restore them easily. You should only delete artifacts once you are certain that they are no longer needed. Also, once you start deleting application artifacts, other application artifacts might stop working, because they depend on the item that you just deleted.
Delete application elements for the Documents to Review and Approve library.
In this step, you delete the workflows, views, forms, and SmartObject that you generated for the Documents to Review and Approve library.
- From the Documents to Review and Approve application elements page, select the Document Review Workflow and click Delete. You see a message that gives you the options to delete all versions and historical log data. Check both of these options and click Yes. Repeat this step for the Document Approval Workflow.
- You delete artifacts from the Documents to Review and Approve application elements page. To navigate to the application elements page, open the Documents to Review and Approve library. Click the Library tab, then click the Application button found in the K2 group.
- On the application elements page, you see a list of artifacts K2 generated when you created the elements. (Remember, you selected the Data, Forms, Workflow, and Reports elements, and then added a second workflow.) You will begin by deleting the workflow. Select the Document Review Workflow and click the Delete button.
- You see a confirmation message asking if you want to delete all versions and running instances, as well as historical log data. Check the box for each option and click Yes.
- It may take a few minutes for K2 to process the command. First, K2 deletes any active process instances, then it deletes all versions of the workflow. Typically, there is a new version each time you deploy the workflow, so you may have several versions to delete. When the workflow is no longer displayed, you can delete the second workflow. Select the Document Approval Workflow and click Delete.
- Check both boxes to delete all versions and running instances, along with historical data. Click Yes.
- Next, you delete forms. You should delete forms before deleting views. Select the Documents to Review and Approve Workflow Reports form and click Delete. Click Yes for the confirmation. Repeat this step and delete the remaining forms.
- Now, you can delete the views. Select the Documents to Review and Approve Workflow Reports view and click Delete. Click Yes for the confirmation. Repeat this step and delete the remaining views.
- In the steps above, you deleted artifacts individually. To complete the process however, you need to delete the SmartObject. You cannot delete the SmartObject using the Delete button. This is because of underlying associations K2 created when generating the SmartObject. Instead, you will use the Delete All option. This options resolves any associations first, then deletes the SmartObject. Click Delete All. (In fact, you could just click this button in the first place if your intention is removing the entire application artifacts. We just wanted you to see how to delete individual items in the event you need to.)
- You see a confirmation message that tells you all items are removed, including categories. Click Yes.
Finish the clean-up by deleting the SharePoint library and subsite.
In this step, complete your clean-up by deleting the SharePoint libraries and subsite.
- For a complete scrub of your environment, be sure to delete the Documents to Review and Approve and Approved Documents libraries, and finally the subsite (if you created one).
- Delete the Documents to Review and Approve library. From the Library tab, click Library Settings.
- Under Permissions and Management, click Delete this document library, then OK for the confirmation.
- Navigate to the Approved Documents library settings page. Under Permissions and Management, click Delete this document library, then OK for the confirmation.
- Delete the subsite (if you created one). Contact your SharePoint administrator for instructions on deleting sites in your environment.
Summary
The Document Review and Approval tutorial focused on building applications with SharePoint libraries. Now that you have completed this tutorial, you should know:
- How a SharePoint library can store data and start new workflows
- How to add user task and system task steps to the workflow design canvas
- How to build a workflow with a rework loop
- How to start workflows manually from a SharePoint library
- How to include documents as attachments to emails
- How to edit SmartForms to further customize the user experience
- How to clean your environment by deleting artifacts no longer needed