Skip to main content

IRelationship.Relate method

Namespace: NextDesign.Core

Description

Replaces the association end of this association with the specified model.
Path constraints and multiplicity constraints are not checked by this method.

argument

NameTypeDescription
sourceIModelThe source model

You cannot specify null.
targetIModelDestination model

You cannot specify null.
sourceIndexintPosition of the new source
Specifies the index starting from 0.

The destination model will be the additional position in the field that references the origin.
If the specified index is outside the range of the number of elements in the corresponding field on the related destination side, it will be added to the end.
targetIndexintPosition of the new destination
Specifies the index starting at 0.

The model on the related source side will be the additional position in the field that refers to the related destination.
If the specified index is outside the range of the number of elements in the corresponding field on the origin side, it will be added to the end.

Return value

  • void

Exceptions

NameException ClassDescription
Invalid argumentExtensionArgumentExceptionIf null is specified for source or target
The specified model is invalidExtensionInvalidTypeExceptionIf a value that cannot be set to the specified association end is specified
- The specified model type is incompatible with the model type of the new association end
Illegal operationExtensionInvalidOperationExceptionIf self is a deleted model, temporary proxy
If an inoperable relationship is specified for this relationship
- Product Line Feature Assignment Related
- System. Association tagged with Core
- Owned association
Invalid model specifiedExtensionInvalidModelExceptionIf a deleted model or temporary proxy is specified for the model of the origin of the relationship or the destination of the relationship