Transformation rule createObject

This transformation rule is concerned with the generation of rules that create objects of the given classes that are not abstract. It is shown in Figure 14. After rule application the corresponding Class node has been visited and a create rule for this class has been generated. This kind of rules is assigned to layer 1 according to the maxim that first a number of objects is created and then links and missing objects are inserted. All create rules are quite simple, they all have empty left hand sides and contain one node of the given class in the RHS.



Fig. 14: Transformation rule createObject

Transformation rule insertLink_1..01

In the case of 1 to 0..1 associations between two classes we derive two kinds of rules, wheres the first rule kind creates a link between two existing instances. The newly created Rule nodes are rules in layer 2 since they create links those corresponding associations have at least one association end with multiplicity 1..1. The rule has three NACs, ensuring that the instances are not already connected to each other or to another instance by a link of this type. The rule insertLink_1..01 ,shown in Fig. 15, creates a Rule node with the rulename n1_an_n2 for an assocoiation with name an starting at a class named n1 (with multiplictiy 1..1) and ending at a class named n2 (with multiplicity 0..1). The LHS of this Rule contains the corresponding Node nodes, the RHS the two Node nodes and the newly created Edge node with corresponding name (an). Since the multiplicity at the source association end is 1..1 the corresponding Node node is connected via an Edge node to a Bound node. To ensure that the Node is bound after rule application, the Attribute bound of this Node (which has to be false in the left hand side) is set to true on the right hand side of the rule. The second rule is created by the transformation rule insertLink_1..01CreateSrc_concrete shown in Fig.16, resp. insertLink_1..01CreateSrc_abstract shown in Fig.17.



Fig. 15: Transformation rule insertLink_1..01

Transformation rule insertLink_1..01CreateSrc_concrete

This rule creates a new Rule that matches an instance of a class n1, creates a new instance of class n2 and connects the two by a link an. To handle the application condition stating that the rule is applied only if any match of an instance of class n1 is already connected to an instance of class n2, one NAC requires that there does not exist an unbound Node named n2 (see the NAC in the lower right corner of Fig.16). The second NAC ensures that the Node named n1 is not already connected to a Node named n2.



Fig. 16: Transformation rule insertLink_1..01CreateSrc_concrete

Transformation rule insertLink_1..01CreateSrc_abstract

This rule creates a new rule that matches an instance of a class n1, creates a new instance of class n2, and connects the two by a link an. Note, that the association an is defined between the class n1 and the abstract class n2-parent, from which the class n2 inherits. To handle the application condition stating that the rule is applied only if any match of an instance of class n1 is already connected to an instance of class n2, one NAC requires that there does not exist an unbound Node named n2 (see the NAC in the lower right corner of Fig.17). The second NAC ensures that the Node named n1 is not already connected to a Node named n2_parent.



Fig. 17: Transformation rule insertLink_1..01CreateSrc_abstract

Transformation rule insertLink_01..1

This rule is similar to the rule insertLink_1..01, the association has opposite direction (and therefore the rulename changes).



Fig. 18: Transformation rule insertLink_01..1

Transformation rule insertLink_01..1CreateTgt_concrete

This rule is similar to the rule insertLink_1..01CreateSrc_concrete, the association has opposite direction (and therefore the rulename changes).



Fig. 19: Transformation rule insertLink_01..1CreateTgt_concrete

Transformation rule insertLink_01..1CreateTgt_abstract

This rule is similar to the rule insertLink_1..01CreateSrc_abstract, the association has opposite direction (and therefore the rulename changes).



Fig. 20: Transformation rule insertLink_01..1CreateTgt_abstract

Transformation rule insertLink_1..1

In the case of 1 to 1 associations between two classes we derive three kinds of rules in layer 2, wheres the first rule kind creates a link between two existing instances. The newly created Rule nodes are rules in layer 2 since they create links those corresponding associations have at least one association end with multiplicity 1..1.It has three NACs, ensuring that the instances are not already connected to each other or to another instance by a link of this type. The rule insertLink_1..1, shown in Fig. , creates a Rule node with the rulename n1_an_n2 for an assocoiation with name an starting at a class named n1 (with multiplictiy 1..1) and ending at a class named n2 (also with multiplicity 1..1). The LHS of this Rule contains the corresponding Node nodes, the RHS the two Node nodes and the newly created Edge node with corresponding name. Since the multiplicity at the source association end is 1..1 the corresponding Node node is connected via an Edge node to a Bound node. To ensure that the Nodes are bound after rule application, the Attributes bound of the Nodes are set to true on the right hand side of the rule. The second rule is created by the transformation rule insertLink_1..1CreateSrc_concrete shown in Fig.22, resp. insertLink_1..1CreateSrc_abstract shown in Fig.23, the third one is created by the transformation rule insertLink_1..1CreateTgt_concrete shown in Fig.25, resp. insertLink_1..1CreateTgt_abstract shown in Fig.26.




Fig. 21: Transformation rule insertLink_1..1

Transformation rule insertLink_1..1CreateSrc_concrete

This rule creates a new Rule that matches an instance of a class n1, creates a new instance of class n2 and connects the two by a link an. To handle the application condition stating that the rule is applied only if any match of an instance of class n1 is already connected to an instance of class n2, one NAC requires that there does not exist an unbound Node named n2 (see the NAC in the lower right corner of Fig.22). The second NAC ensures that the Node named n1 is not already connected to a Node named n2.



Fig. 22: Transformation rule insertLink_1..1CreateSrc_concrete

Transformation rule insertLink_1..1CreateSrc_abstract

This rule creates a new Rule that matches an instance of a class n1, creates a new instance of class n2, and connects the two by a link an. Note, that the association an is defined between the class n1 and the abstract class n2-parent, from which the class n2 inherits. To handle the application condition stating that the rule is applied only if any match of an instance of class n1 is already connected to an instance of class n2, one NAC requires that there does not exist an unbound Node named n2 (see the NAC in the lower right corner of Fig.23). The second NAC ensures that the Node named n1 is not already connected to a Node named n2_parent.



Fig. 23: Transformation rule insertLink_1..1CreateSrc_abstract

Transformation rule insertLink_1..1otherDirection

This rule is similar to the rule insertLink_1..1, the association has opposite direction (and therefore the rulename changes).



Fig. 24: Transformation rule insertLink_1..1otherDirection

Transformation rule insertLink_1..1CreateTgt_concrete

This rule is similar to the rule insertLink_1..01CreateSrc_concrete, the association has opposite direction (and therefore the rulename changes).



Fig. 25: Transformation rule insertLink_1..1CreateTgt_concrete

Transformation rule insertLink_1..1CreateTgt_abstract

This rule is similar to the rule insertLink_1..01CreateSrc_abstract, the association has opposite direction (and therefore the rulename changes).



Fig. 26: Transformation rule insertLink_1..1CreateTgt_abstract

Transformation rule insertLink_01..01

The Rule node (named n1_an_n2 in layer 3) added to the RuleSet node by this rule has two Nodes (named n1 and n2 as the corresponding Class nodes) in the LHS, and additionally the new created Edge node (named an as the corresponding Association node) in the RHS. The NACs ensure that an Edge between this Nodes does not already exist, that Node n1 is not connected to another n2-Node, and that Node n2 is not connected to another n1-Node.



Fig. 27: Transformation rule insertLink_01..01

Transformation rule insertLink_01..*

The Rule node (named n2_an_n1 in layer 3) added to the RuleSet node by this rule has two Nodes (named n2 and n1 as the corresponding Class nodes) in the LHS, and additionally the new created Edge node (named an as the corresponding Association node) in the RHS. The NACs ensure that an Edge named an between this Nodes does not already exist, and that Node n1 is not connected to another n2-Node.



Fig. 28: Transformation rule insertLink_01..*

Transformation rule insertLink_*..01

The Rule node (named n1_an_n2 in layer 3) added to the RuleSet node by this rule has two Nodes (named n1 and n2 as the corresponding Class nodes) in the LHS, and additionally the new created Edge node (named an as the corresponding Association node) in the RHS. The NACs ensure that an Edge named an between this Nodes does not already exist, and that Node n1 is not connected to another n2-Node. Note, that (compared with rule insertLink_01..*) only the direction of the association an is changed.



Fig. 29: Transformation rule insertLink_*..01

Transformation rule insertLink_*..*

The Rule node (named n1_an_n2 in layer 3) added to the RuleSet node by this rule has two Nodes (named n1 and n2 as the corresponding Class nodes) in the LHS, and additionally the new created Edge node (named an as the corresponding Association node) in the RHS. The NAC ensures that an Edge named an between this Nodes does not already exist.



Fig. 30: Transformation rule insertLink_*..*