Resolution While Operating Within a Workspace

If you are operating within a workspace, Repository returns the version of the object that is present in the workspace. If Repository cannot return the in-workspace object to you, it returns an error. Repository might fail to return an in-workspace version of the object you requested in the following situations:

For example, the following figure shows one item in the collection Persons-of-V3-of-Main. The target object of the item is Christoph. Because you have not yet navigated along the relationship, the figure does not show which particular version of Christoph will be returned to you; it shows only that it will be Version 2-of-Christoph or Version 3-of-Christoph. If you are operating in a workspace that contains Version 1-of-Christoph, Repository returns an error. When you invoke the get_Target method of the IRelationship interface, Repository cannot find a suitable version of Christoph to return to you. It cannot return Version 1 because Version 1-of-Christoph is not related to the source of the navigation. It cannot return Version 2 or Version 3 because neither Version 2-of-Christoph nor Version 3-of-Christoph is in the workspace in which you are operating. (Remember, the workspace contains object versions and a workspace can contain only one version of each object.)

In your programs, you can avoid this error by manipulating target object collections rather than relationship collections. This error occurs only when a collection includes an item that Repository cannot resolve to an in-workspace object. The only situation in which this occurs is described above: The collection is a relationship collection, and none of its items refers to the specific version of the target object that is in the workspace. When you establish a target-object collection, however, each item in the collection is a Repository object (rather than a relationship to a Repository object). If you establish the collection while operating within a workspace, each item in the collection is a version of the target object that is present in the workspace.