This method is used to add a new item to a Repository relationship collection, when the sequencing of relationships in the collection is not important. An interface pointer for the new relationship is passed back to the caller.
HRESULT Add(
IDispatch *plReposObj,
BSTR Name,
IRelationship **pplRelship
);
Parameters
*plReposObj
[in]
The object for which a relationship is to be added to the relationship collection.
Name
[in]
The name of the new relationship.
*pplRelship
[out]
The newly added relationship's IRelationship interface pointer.
Return Value
S_OK
The method completed successfully.
Error
This method failed to complete successfully.
Remarks
You can add a relationship to a collection only when the collection's source object is also the collection's origin object.
When you call this method, the origin version must be unfrozen.
You can use this method to create a new versioned relationship between the source object version and a version of the target object. You cannot use it to enlarge a versioned relationship. If the source object version already has a relationship to any version of the target object, this method will fail. You can include another version of the target object in the versioned relationship by adding an item to the versioned relationship's TargetVersions collection.
The value of plReposObj is the specific version of the target object.
If you are operating within the context of a workspace, the target object version you specify with plReposObj must be present in the workspace.