Function Name: Add Associate Relationship

Definition

Adds an object as an associate of another object.

The from_object and link_object must always be resolved. The to_object may either be resolved or unresolved. It should be noted that relationships between objects in different transmittals are not implicitly bi-directional, so the make_two_way parameter will have an effect only if:

If only the from_object is resolved, then the association can only be one way.

Returns

SE_SUCCESS - and the requested association relationship is added, if valid parameters were passed in and all operations succeeded.

SE_INVALID_OR_NULL_OBJECT - and no changes are made, if

  1. from_object is NULL, is unsaved (i.e., has not yet been added to the transmittal), or does not belong to a valid SDRM class;
  2. to_object is NULL, is unsaved (i.e., has not yet been added to the transmittal), or does not belong to a valid SDRM class;
  3. link_object is non-NULL and either is unsaved (i.e., has not yet been added to the transmittal), or does not belong to a valid SDRM class.

SE_UNPUBLISHED_OBJECT - and no changes are made, if to_object is in another transmittal than from_object, but is not published by that transmittal.

SE_UNRESOLVED_START_OBJECT - and no changes are made, if

  1. from_object is an unresolved object, or
  2. link_object is non-NULL and is an unresolved object.

SE_INVALID_ACCESS_MODE - and no changes are made, if

  1. from_object (and link_object if specified) is in a transmittal that is open in SE_READ_ONLY mode;
  2. to_object is in a transmittal that has not been opened for writing or modification, so no association could be created from to_object.

SE_FAILURE - and no changes are made, if

  1. make_two_way was true and the SDRM defines the relationship as bidirectional, but to_object is unresolved, so no association could be created from to_object to from_object;
  2. the API implementation specified does not provide this function in its shared library, and dynamic binding is specified at compile time.

Prototype


extern SE_STATUS_CODE_ENUM
SE_AddAssociateRelationship
(
SE_OBJECT from_object, (notes)
SE_OBJECT to_object, (notes)
SE_OBJECT link_object, (notes)
SE_BOOLEAN make_two_way (notes)
);

Parameters Notes

from_object

 object to which an associate is being added - must be
    resolved.

to_object

 associate object being added - can be resolved or
    unresolved.

link_object

 the link object that will be traversed to reach
    the associate object, if applicable; must be resolved, if provided.

make_two_way

 if true, then if the SDRM defines the association as a
    bidirectional association and both the from_object and to_object are
    resolved, then the other half of the association (to_object ->
    from_object) is also created by this function.

Next: Add Component Relationship. Up:Index.