Relationships

Relationship objects enable developers to create links between related collaboration objects. Relationships can be created between new objects or existing objects, including documents, external web sites, or other types of objects inside or outside of the teamspace in which the Relationship object is created.

The Collaboration API contains elements that developers can use to define, access, and manage relationship objects from within FileNet P8 applications. Key relationship elements are:

Relationship Fundamentals

Depending on the type of relationship being created, a RelationshipInfo object comprises some or all of the following elements:

A relationship is created when items from the list above are added to a RelationshipInfo object and passed to the RelationshipManager's addRelationship method, as described below.

Creating Relationships

In a standard teamspace structure, relationships are created and maintained within the _relationships folder, a subfolder of the teamspace's _internal folder.

The following code describes how a Relationship object might be created in a known object store and teamspace (for information on teamspace objects, see Teamspaces; for information on creating and managing object stores, see the Content Java API topic, Working With Object Stores).

    // create a new RelationshipInfo object
    RelationshipInfo relationshipInfo = new RelationshipInfo
      (FromType, fromID, toType, toID, toVersionID );
    LinkManager relationshipManager = teamSpace.getRelationshipManager();
    Relationship relationshipObject = relationshipManager.addRelationship(relationshipInfo);

Managing Relationships

The RelationshipManager object can be used to remove or refresh any existing Relationship object, or create new relationships from existing RelationshipInfo objects.

Additional Information

For information on how relationships are created and managed within the Team Collaboration Manager application, see Related item links.