User Help > Working With Documents > Deleting Documents from the Windchill RV&S Database > Considerations and Best Practices for Deleting Versioned Documents
  
Considerations and Best Practices for Deleting Versioned Documents
Considerations for Deleting Versions
A versioned content can be a part of one or more versions of a selected document. Although it is possible to delete any version, the versioned contents which are part of more than one version of the document, are excluded from the delete operation. Such exclusions maintain the data and structural integrity of the versioned documents, that share versioned contents. Such version contents are listed as ExcluedContents in the API output of the im deletesegment command -- reportOnly option. The versioned nodes that are in use in other versioned documents are retained. For example, if Version Document 1.1 includes Content 1.1 and Version Document 1.2 also includes Content 1.1, then deleting Version Documents 1.1 or 1.2 will not delete Content 1.1.
The versioned contents and versioned shared items, that are not being referenced by any versioned documents other than the one being deleted, are deleted along with selected version document.
The items related to deleted versioned document or versioned contents are marked with the annotations depicting the internal ID of the versioned document or versioned content that got deleted, the user who has performed delete operation, and the timestamp for the operation.
After deleting all the versions of the live document, the subsequent versioning operation creates forced versions of items for which the version was deleted. Such forced versioning operation may not copy the traces on the generated versions of the live document.
A versioned document which has inserted or included content or document can be deleted.
Best Practices for Deleting Versions
Delete the versioned documents only as a pre-requisite for deleting a live document.
Do not delete the version documents in an arbitrary manner. Delete all the version documents in order, starting from the last version to the first version.
You should avoid invoking subsequent versioning operations after deleting one or more versioned document.
For a document, delete the live document and all related document versions in a single API session. This avoids any modification of the live document, versioned documents, or subsequent versioning attempts of the document by users.
Implement a well-defined process for deleting documents as per business requirements.
The live documents and their versions being deleted, must not be under active usage or development. For example,
The documents must not be in the process of viewing, editing, or versioning.
They are not available for creating traces and adding relationships at the segment and content levels.
They are not part of documents and contents used for computations or change packages. To avoid any inconsistencies in the computed field values, the document or any of its contents should not participate in any manner, directly or indirectly, in the computation field formula. In case the document selected for delete operation or any of its contents participate in the field computations, the resultant field computation values will be different prior to and after successful delete operation.
Considerations and Best Practices for Deleting Versioned Test Documents
If Excluded Contents have been added to the test sessions using any version of the test document as the context, then such Excluded Contents are removed from all the test sessions while deleting any version of the test document. For example, refer to the following image.
Deleting test Document Version 123-1.0, will remove ExcludedContent 124-1.0 from both the test sessions i.e., Test Session 1 and Test Session 2
To avoid such removal of versioned test cases from all the related test sessions, it is advisable to use the All content items option for all the subsequent check-ins of the live test document. This will ensure that every time the live test document is versioned, the content items are also versioned and therefore are not removed from the test sessions if any version of test document is deleted. For example, refer to the following image.
Deleting test Document Version 123-1.0, will remove only the test case from Test session 1
For more information on Excluded Contents see im deletesegment.