Accessing Relationship Collections

Meta Data Services Programming

Meta Data Services Programming

Accessing Relationship Collections

Access to relationship collections is supported at both the COM and Automation level.

You cannot add or delete a relationship collection after it is created. Sometimes a relationship collection contains no relationships, but the collection still exists. If you retrieve such an empty relationship collection, the repository engine returns an interface pointer to a relationship collection, just as it would for any other relationship collection.

Loading object instance collections can be asynchronous. The calling thread should check to determine whether the load is complete. If the calling thread tries to read data, refresh the collection, or construct an enumerator while loading is in progress, it will be blocked until the load is complete.

Note  You can use IRepositoryObject2 to access specific collections, even if the collections share the same name through an inherited interface. For more information, see IRepositoryObject2 Interface.

To Use
Add a relationship to a relationship collection The Add method of the IRelationshipCol interface.
Remove a relationship from a relationship collection The Remove method of the IRelationshipCol interface.
Enumerate the relationships within a relationship collection (Automation) The syntax relationshipCollection(index), as for retrieving an item from any Automation collection.

(COM) The get_Count and get_Item methods of the IRelationshipCol interface. You can also use the _NewEnum method of the IRelationshipCol interface to obtain a standard enumerator interface for the collection.

See Also

Navigating a Repository