The following helper rules are creating Bound-Nodes to ensure the
application conditions of the rules. This application conditions are
not yet supported by AGG, so that they are handled via Bound-Nodes. If
a Class node is connected to
an association end with multiplicity 1..1 the corresponding Node node gets an Edge to a helper Bound node which has attributes for
the bound-kind (bound or not bound) and the corresponding association
name. The Bound-Node ensures that the Node
cannot be connected to more than one other Nodes along an Edge of the corresponding
association. Therefore each rule of layer 1 creating one of the
concerned Nodes in the RHS gets an additional Bound-Node (that is
realized by the rules createBoundSrc,
createBoundSrc_abstract, createBoundTgt, and createBoundTgt_abstract, see Fig.31
and FIg.32).
New Nodes can be created in
layer 2. A Node n1 bound to an association an can be created in two different
rule kinds:
1) The rule creates a new Node
n1 and a new Edge an (corresponding to association an). Then the Bound-Node is already
created by one of the rules insertLink_1..01, insertLink_1..01CreateSrc_concrete, insertLink_1..01CreateSrc_abstract, insertLink_01..1, insertLink_01..1CreateTgt_concrete, insertLink_01..1CreateTgt_abstract, insertLink_1..1, insertLink_1..1CreateSrc_concrete, insertLink_1..1CreateSrc_abstract, insertLink_1..1otherDirection, insertLink_1..01CreateTgt_concrete, or insertLink_1..01CreateTgt_abstract.
2) The rule creates a new Node
n1 and a new Edge an2 != an. Then Node n1 is not connected to a Bound-Node
although it has to. Rule createBoundSrcAtOtherLink
(auch as rules createBoundSrcAtOtherLink_abstract,
createBoundTgtAtOtherLink, and
createBoundTgtAtOtherLink_abstract)
creates a new Bound-Node and connects Node
n1 to it (note, that attribute
bound is set to false in that
case).
Helper rule createBoundSrc
This rule creates for a Node
named n of the right hand
side of a rule that creates this Node
(ensured by the attribute
condition), a helper Node
named Bound, if the Class
corresponding to Node named n is connected to an AssEnd node with multiplicity 1..1.
Now the created Node gets an
additional Edge to a
Bound-Node those Attribute
bound is set to false (creating only the Node does not bound it).
Fig. 31: Transformation rule createBoundSrc
Helper rule createBoundSrc_abstract
This rule creates for a Node
named n of the right hand
side of a rule that creates this Node
(ensured by the attribute
condition), a helper Node
named Bound, if the parent of
the Class
corresponding to Node named n is connected to an AssEnd node with multiplicity 1..1.
Now the created Node gets an
additional Edge to a
Bound-Node those Attribute
bound is set to false (creating only the Node does not bound it).
Fig. 32: Transformation rule createBoundSrc_abstract
Helper rule createBoundSrcAtOtherLink
The Rule named r creates a new Node n those corresponding class is the
1..1 association end of association an,
and a new Edge named x from Node n to another Node y. The attribute conditions ensure
that x!=an or y!=n2. Then Node
n is not connected to a
Bound-Node
although it has to. Rule createBoundSrcAtOtherLink
creates a new Bound-Node and connects Node
n to it (note, that attribute
bound is set to false in that
case).
Fig. 33: Transformation rule createBoundSrcAtOtherLink
Helper rule createBoundSrcAtOtherLink_abstract
The Rule named r creates a new Node n those corresponding super-class
is the 1..1 association end of association an, and a new Edge named x from Node n to another Node y. The attribute conditions ensure
that x!=an or y!=n2. Then Node
n is not connected to a
Bound-Node
although it has to. Rule createBoundSrcAtOtherLink
creates a new Bound-Node and connects Node
n to it (note, that attribute
bound is set to false in that
case).
Fig. 34: Transformation rule createBoundSrcAtOtherLink_abstract
The helper rules createBoundTgt, createBoundTgt_abstract, createBoundTgtAtOtherLink, and createBoundTgtAtOtherLink_abstract
are quite similar to the ones described above and therefore not
explicit shown and described here.