|
@@ -215,10 +215,55 @@ Tracability links
|
|
|
As the metamodels are merged together into a single metamodel, models can contain elements from both.
|
|
|
It is often useful to create some kind of link between these different metamodels.
|
|
|
However, a simple merge does not allow for this, as the different metamodels form their own "islands".
|
|
|
-To create links between them, for example for matching, or for tracability, we need tracability links.
|
|
|
+To create links between them, for example for matching or tracability, we need tracability links.
|
|
|
|
|
|
Definition
|
|
|
^^^^^^^^^^
|
|
|
|
|
|
+Tracability links, or links between different metamodels, can be created by passing a callback function.
|
|
|
+As the intermediate merged metamodels are not designed to be modified by users (though they can be), the callback operation is executed on the merged metamodel.
|
|
|
+Only after the changes in the callback function are applied, is the metamodel RAMified.
|
|
|
+
|
|
|
+This callback function takes a series of operations, just like all previous operations.
|
|
|
+The only exception is that the model is to be put to *None*, as changes to other models are not allowed in this context.
|
|
|
+For example, to define a tracability link between a *PetriNets/Transition* and *ReachabilityGraph/Transition*, we can do the following when defining the transformation::
|
|
|
+
|
|
|
+ >>> def callback():
|
|
|
+ ... instantiate(None, "Association", edge=("PetriNets/Transition", "ReachabilityGraph/Transition"), ID="PN2RG_Transition")
|
|
|
+ >>> transformation_add_MT({"PetriNets": "PetriNets"}, {"ReachabilityGraph": "ReachabilityGraph"}, "pn_analyse", open("models/pn_analyse.mvc", "r").read(), callback)
|
|
|
+
|
|
|
+As the forward slash (/) is already used to distinguish between the metamodel tag and the original entity, entities defined through a callback function should not contain this same symbol.
|
|
|
+
|
|
|
Use
|
|
|
^^^
|
|
|
+
|
|
|
+In the transformation, it is now possible to use all (RAMified) entities of the *PetriNets* metamodel (e.g., *PetriNets/Place*, *PetriNets/Transition*), the *ReachabilityGraph* metamodel (e.g., *ReachabilityGraph/Transition*, *ReachabilityGraph/State*), and the newly defined *PN2RG_Transition* element.
|
|
|
+As specified in the callback, the *PN2RG_Transition* association connects only the *PetriNets/Transition* and *ReachabilityGraph/Transition* elements.
|
|
|
+Therefore, no links can be created between any other elements.
|
|
|
+
|
|
|
+This new entity can be used in the rules like any other, either in the LHS, RHS, or the NACs::
|
|
|
+
|
|
|
+ LHS {
|
|
|
+ Pre_PetriNets/Transition pre_pn_t {
|
|
|
+ ...
|
|
|
+ }
|
|
|
+ }
|
|
|
+ RHS {
|
|
|
+ Post_PetriNets/Transition post_pn_t {
|
|
|
+ ...
|
|
|
+ }
|
|
|
+ Post_ReachabilityGraph/Transition post_rg_t {
|
|
|
+ ...
|
|
|
+ }
|
|
|
+ Post_PN2RG_Transition (post_pn_t, post_rg_t) {
|
|
|
+ ...
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+This is in contrast to AToMPM, where there was a notion of *GenericLink*, which could connect all entities, but was not defined at the domain-specific level.
|
|
|
+In the Modelverse, these tracability links are also modelled explicitly, such that their use is also governed by the usual conformance rules.
|
|
|
+
|
|
|
+When the transformation is finished, all entities in the model are split across the multiple tagged metamodels.
|
|
|
+Tracability links, not belonging to any of them, are stored in a separate model, typed by the *Tracability* metamodel.
|
|
|
+Future model merge operations can pass this tracability model, in order to restore the original model that was split.
|
|
|
+This is mostly useful to developers of the Modelverse, and is not elaborated here.
|