Previous | UML Classes | Table of Contents | UML Packages | Next |
(IntermediateActions ) CreateLinkAction is a write link action for creating links.
•
WriteLinkAction (from IntermediateActions ) on page 303
Issue 8158 -clarify that insertion point must be > 0
This action can be used to create links and link objects. There is no return value in either case. This is so that no change
of the action is required if the association is changed to an association class or vice versa. CreateLinkAction uses a specialization
of LinkEndData called LinkEndCreationData , to support ordered associations. The insertion point is
specified at runtime by an additional input pin, which is required for ordered association ends and omitted for unordered
ends. The insertion point is an integer greater than 0 giving the position to insert the link, or unlimited, to insert at
the end. Reinserting an existing end at a new position in an ordered unique structural feature moves the end to that position.
CreateLinkAction also uses LinkEndCreationData to support the destruction of existing links of the association that connect
any of the objects of the new link. When the link is created, this option is available on an end-by-end basis, and causes
all links of the association emanating from the specified ends to be destroyed before the new link is created.
No additional attributes
• endData : LinkEndCreationData [2..*] Specifies ends of association and inputs. (Redefines LinkAction::endData)
[1] The association cannot be an abstract classifier.
self.association().isAbstract = #false
CreateLinkAction creates a link or link object for an association or association class. It has no output pin, because links
are not necessarily values that can be passed to and from actions. When the action creates a link object, the object could
be returned on output pin, but it is not for consistency with links. This allows actions to remain unchanged when an association
is changed to an association class or vice versa. The semantics of CreateLinkObjectAction applies to creating link objects
with CreateLinkAction .
This action also supports the destruction of existing links of the association that connect any of the objects of the new
link. This option is available on an end-by-end basis, and causes all links of the association emanating from the specified
ends to be destroyed before the new link is created. If the link already exists, then it is not destroyed under this option.
Otherwise, recreating an existing link has no effect if the structural feature is unordered and non-unique.
The semantics is undefined for creating a link for an association class that is abstract. The semantics is undefined for creating
a link that violates the upper multiplicity of one of its association ends. A new link violates the upper multiplicity of
an end if the cardinality of that end after the link is created would be greater than the upper multiplicity of that end.
The cardinality of an end is equal to the number of links with objects participating in the other ends that are the same as
those participating in those other ends in the new link, and with qualifier values on all ends the same as the new link, if
any.
The semantics is undefined for creating a link that has an association end with isReadOnly=true after initialization of the
other end objects, unless the link being created already exists. Objects participating in the association across from a writeable
end can have links created as long as the objects across from all read only ends are still being initialized. This means that
objects participating in links with two or more read only ends cannot have links created unless all the linked objects are
being initialized.
Creating ordered association ends requires an insertion point for a new link using the insertAt input pin of LinkEndCreationData .
The pin is of type UnlimitedNatural with multiplicity of 1..1. A pin value that is a positive integer less than or equal to
the current number of links means to insert the new link at that position in the sequence of existing links, with the integer
one meaning the new link will be first in the sequence. A value of unlimited for insertAt means to insert the new link at
the end of the sequence. The semantics is undefined for value of zero or an integer greater than the number of existing links.
The insertAt input pin does not exist for unordered association ends. Reinserting an existing end at a new position in an
ordered unique structural feature moves the end so that it is in the position specified after the action is complete.
No specific notation
CreateLinkAction is introduced to create links.
CreateLinkAction is unchanged from UML 1.5.