im deletesegment
Deletes a document and its content which is either live, branched, or versioned in Windchill RV&S. The command also allows you to evaluate the overall impact of the delete document operation.
* 
This command is available only through the Windchill RV&S Application Programming Interface (API).
Synopsis
im deletesegment [--reportOnly] [--[no]listAllIBPLSourceItems] [--includeOrphanVersionContents] [--removeRelationships] [(-?|--usage)] [(-F file|--selectionFile=file] [(-N|--no)] [(-Y|--yes)] [--[no]batch] [--cwd=directory] [--forceConfirm=[yes|no]] [-g|--gui] [--hostname=server] [--password=password] [--port=number] [--quiet] [--settingsUI=[gui|default]] [-status=[none|gui|gui.actions|default]] [--user=username]
Description
The im deletesegment command deletes a document and its contents from the Windchill RV&S database. In order to delete the segment, the user must have DeleteItem permission. Also, the ModifyDeleteItemRule permission should be enabled for all three types; that is segment, node, and shared item for the document being deleted. This permission is enabled when the May be deleted, controlled by rule attribute is selected at the type level. For more information on configuring type attributes, see To configure type attributes in the GUI.
When used with the --reportOnly option, the im deletesegment command allows you to evaluate the document structure and its relationships before deleting the document. To avoid any kind of data loss, it is highly advisable to execute the im deletesegment command with --reportOnly option prior to executing im deletesegment command with –reomveRelationships option.
Options
This command takes the universal options available to all im commands, as well as some general options. See the options reference page for descriptions.
--reportonly
This option generates a report of all the factors blocking the delete operation in the form of an API output. The report contains a list of all the related items that are impacted by the delete process, the configuration of these items, and the data-specific errors. It lists the existing baselines and labels of the document being deleted. It also finds the orphan version content items blocking the delete document process and allows them to be deleted as part of im deletesegment command.
In case the document being deleted is a part of test management, the report lists the test sessions related to test cases from the test document.
Some of the key fields reported in the output are:
OrphanVersionContents: The orphan versioned content items are not associated with any versioned document. These are versioned content items that are created without checking in the parent document.
ExcludedContents: Subsequent check-ins of live test document with the Editedsignificantfields since last version option, do not create new versions of the content items. Instead, content versions from the preceding version of the document are added to the new document version being created. Such versioned contents which participate in more than one document version structure are listed in API output as ExcludedContents. These version contents are excluded from the delete document operation and are retained in the database. However, if such excluded contents are test case version items and have been added to the test sessions, then these are removed from all the test sessions as part of im deletesegment operation with --removeRelationships option. For more information, see Considerations and Best Practices for Deleting Versioned Test Documents.
affectedItems: These are items which use either the document being deleted or one or more contents from the document as an IBPL value.
AdditionalItems: These are the shared items associated with the content items. These are deleted as a part of delete document operation.
UsedAsSubSegment: If the selected document is used as a sub-document in other documents, this field lists all such other documents under the referencedBy by sub-field.
ReferenesToSegment: If the content being deleted is a place holder node representing a sub-document, this field lists the referenced document under references sub-field.
SharedBy: This API field lists the branches in Share reference mode for the content being deleted.
IsOperationAllowed: While running the im deletesegment command with the –reportOnly option, the isOperationAllowed field represents the feasibility of the operation considering all the blocking factors existing in the system at the time of execution of the command. If there is at least one blocking factor present in the system, the value of the field is false. Note that, a true value for this field does not guarantee the successful deletion of the selected document. If the selected document or any of its contents is still active, it can potentially introduce a blocking factor for delete document operation.
IsSegmentDeleted: This field represents the outcome of the delete document operation when the im deletesegment command is invoked with --removeRelationships option. If the value of the sub-field isDeleted is true, it indicates that the selected document has been deleted successfully.
--listAllIBPLSourceItems
This option lists all the IBPL source items which can prevent the deletion of the selected item. The default --[no]listAllIBPLSourceItems lists only the first IBPL source item.
--includeOrphanVersionContents
This option is useful when deleting the live contents as it removes the redundant copies of the content. This option is executed by default with the im deletesegment --reportOnly and im deletesegment --removeRelationships command. If you do not wish to include the orphan version content items in the delete operation you must explicitly specify the --[no]includeOrphanVersionContents option. However, if this option is specified and there are orphan version content items associated with the document, the delete process is blocked.
--removeRelationships
This option deletes the documents along with the contents. The delete operation is aborted if any blocking factors are encountered.
* 
Deleting documents using the im_deletesegment command may have an adverse impact on the system performance. For recommendations on reducing this impact, refer to the Recommendations for “Reducing the Impact of the Delete Item Operation on System Performance” section in the Windchill RV&S Performance Tuning Guide.
See Also
Miscellaneous: options, preferences
Was this helpful?