IRepositoryItem::Delete

Meta Data Services Programming

Meta Data Services Programming

IRepositoryItem::Delete

This method deletes a repository item.

HRESULT Delete(void);

Return Value

S_OK

The method completed successfully.

Error Values

This method failed to complete successfully.

Remarks

If the item to be deleted is a repository object version, this method fails unless the object version satisfies the basic requirements for object-version deletion.

Furthermore, if the object version is checked out to a workspace, the Delete method fails unless you invoke it from within the context of that workspace. If the object version satisfies both of these restrictions, the repository engine deletes it and its relationships, including any delete-propagating origin relationships. For each of these relationships, the repository engine considers performing one or more propagated deletions.

If the item to be deleted is an origin versioned relationship, this method fails unless the source object version satisfies the basic requirements for changing an object version.

If the source object version is changeable, the repository engine deletes the entire relationship (rather than merely removing one item from the TargetVersions collection of the relationship). That is, after this method finishes, no version of the destination object remains related to the origin object version. Then, if the relationship is a delete-propagating relationship, the repository engine considers performing one or more propagated deletions.

If the item to be deleted is a destination versioned relationship, the repository engine performs object-version resolution strategy to yield a single origin object version from the TargetVersions collection of the relationship. If that origin object version does not satisfy the basic requirements for changing an object version, this method fails.

If that origin object version is changeable, the repository engine removes it from the TargetVersions collection of the relationship. Then, if the relationship is a delete-propagating relationship, the repository engine considers performing one or more propagated deletions.

See Also

Propagating Deletes

IRepositoryItem Interface

Requirements for Changing an Object-Version

Requirements for Object-Version Deletion

Resolution Strategy for Objects and Object Versions

Workspace Context