|
|
The tool manages IDs for all model elements and mappings between them for traceability reasons.
|
|
|
The tool manages IDs for all model elements and mappings between them for traceability reasons. This description is based on [the description for the translation process](Behavioral_Description_of_Translations).
|
|
|
|
|
|
## Code -> Architecture
|
|
|
## <a name="code2arch"></a>Code -> Architecture
|
|
|
Exporting an architecture model from the code is executed within 4 steps, from which each step contains a set of steps itself.
|
|
|
|
|
|
![TransformationManager.extractImplementationModelFromCode]
|
|
|
(/uploads/cd2b74fe4897d111796654572d0ad4e3/ID-Mapping_Model_Export.png)
|
|
|
|
|
|
### Code <-> Implementation Model
|
|
|
First, each implementation model element gets an ID via the ID2ObjectMapper. It creates a map (EObject, UUID).
|
|
|
Then, a map (UUID, Transformation) from a model element's UUID to the element's transformation object is created using the method EmbedTransformationRegistry.createID(..), based on the first (EObject, UUID) map.
|
|
|
The id mapping requires the code elements as input. First, an architecture implementation model (AIL) is [exracted from the code](#code2ail). This extraction has four results:
|
|
|
|
|
|
![TransformationManager.extractImplementationModelFromCode](/uploads/1ee8516e405d940f0960d37ad88f318b/TransformationManager.extractImplementationModelFromCode.png)
|
|
|
1. A list of transformation objects, that represent the tracing between code elements and AIL elements. These transformation objects are reused later, when the model is [integrated with the code](#arch2code).
|
|
|
2. A map of IDs to transformation objects
|
|
|
3. A list of AIL EObjects.
|
|
|
4. A map of AIL EObjects to their IDs.
|
|
|
|
|
|
In the next steps of the [translation process](Behavioral_Description_of_Translations), the steps import a list of EObjects, and a map of EObjects to their IDs. After the translation they export a list of new EObjects that represent the prior EObjects in another language or another style (for the intermodule transformations), and a map of these EObjects to their IDs. The IDs stay the same for EObjects that represent the same semantics.
|
|
|
|
|
|
### Implementation Model <-> IL
|
|
|
The TransformationManager class gives the (EObject, UUID) map into the Implementation Model <-> IL transformations.
|
|
|
At last, the id mapping of the model extraction process exports:
|
|
|
|
|
|
First, the M2MTransformationComponentImpl will create two maps (UUID, TNode) and (TNode, UUID) for all TNodes using the method createIDs(..). The TNodes that represent elements that already had an ID in the (EObject, UUID) map, use that ID.
|
|
|
1. A list of transformations from the AIL to the Code
|
|
|
2. A map of IDs to EObjects of the AIL
|
|
|
3. A list of EObjects of the ADL
|
|
|
4. A map of EObjects of the ADL to their IDs.
|
|
|
5. A map of IDs from AIL EObjects to ADL EObjects.
|
|
|
|
|
|
Second, a map (src-UUID*, trg-UUID*) is created using the method M2MTransformationManager.exportTraces(..). This map uses the Trace elements in the TGGs to relate IL element UUIDs to implementation model element UUIDs.
|
|
|
### <a name="code2ail"></a>Code <-> Implementation Model
|
|
|
In the perspective of the ID mapping, the extraction process has 3 steps.
|
|
|
|
|
|
At last, the M2MTransformationManager clears the graph and only keeps the IL model. It then uses its mapId2Objects(..) method to create four maps: for each, the initial and the result model, two maps (UUID, EObject) and (EObject, UUID).
|
|
|
The first step takes the code as input and creates a model representation. It exports a list of transformation objects and the AIL model.
|
|
|
The second step takes the AIL model and returns a map of AIL model elements to IDs.
|
|
|
The third step takes this ID map and creates a map of IDs to the transformations that handle the EObjects that are represented by that ID.
|
|
|
|
|
|
![TransformationManager.extractImplementationModelFromCode](/uploads/1ee8516e405d940f0960d37ad88f318b/TransformationManager.extractImplementationModelFromCode.png)
|
|
|
|
|
|
Therefore at the end, the TGG transformation contains as its result four maps:
|
|
|
* Initial Model: (UUID, EObject)
|
|
|
* Initial Model: (EObject, UUID)
|
|
|
* Result Model: (UUID, EObject)
|
|
|
* Result Model: (EObject, UUID)
|
|
|
### <a name="ail2il"></a>Implementation Model <-> IL
|
|
|
The model-to-model transformation uses triple graph grammars for translating the initial model to the target model. It does so in seceral steps:
|
|
|
|
|
|
The TransformationManager gives the Initial Model (EObject, UUID) to the next model transformation.
|
|
|
1. It first imports the initial model to the TGG engine. It creates Triple Graph Nodes (TNodes) for each model object, and a map of these TNodes to the EObjects they represent.
|
|
|
2. Then it executs the transformation, thereby creating a list of TNodes for the initial graph, the result graph, and the correspondence graph.
|
|
|
3. It takes the complete triple graph, the map of TNodes of the initial model to their EObjects, and the imported map of EObjects of the initial model to their IDs to create a map of IDs to the elements of the initial and result model.
|
|
|
4. The map of IDs to TNodes of the initial and result model are separated and referenced using the correspondence graph. As a result it creates, a map of IDs of the initial model to IDs of the result model. This map shows the elements of the result model that represent the elements of the initial model.
|
|
|
5. THe triple graph is filtered. Here the correspondence graph and the initial model are removed from the triple graph, leaving only the TNodes of the result model.
|
|
|
6. The TNodes are exported to EObjects, which gives the result model as EObjects. Additionally, a map is created, that maps the TNodes of the result model to these EObjects.
|
|
|
7. The aforementioned map of TNodes to EObjects of the result model, the map of TNodes to EObjects of the initial model from step 1, and the map of IDs of the initial and the result model to the corresponding TNodes is used to create two maps, one of EObjects of the result model to their IDs, and one of EObjects of the initial model to their IDs.
|
|
|
|
|
|
The list of EObjects of the result model and the map of these objects to their IDs are exported in this step.
|
|
|
|
|
|
![M2MTransformationComponentImpl.transformModel](/uploads/49bf4b656b1b1f490bfe02552fef762f/M2MTransformationComponentImpl.transformModel.png)
|
|
|
|
|
|
### IL Module Transformations
|
|
|
The IL module transformations do not change any IDs. It just forwards the eObjectInstance2id_before as Initial Model (EObject, UUID) to the Result Model (EObject, UUID).
|
|
|
### <a name="intermoduletrans"></a>IL Module Transformations
|
|
|
The IL module transformations translated an IL model into another IL model with a different profile. It works with model transformations. Hence it has a left hand side (LHS) and a right hand side (RHS). The LHS is the initial model. The RHS is the result model. This transformation comprises 4 steps:
|
|
|
|
|
|
1. The initial model is imported into the transformation engine. This creates a list of Graph Nodes that represent the EObjects.
|
|
|
2. The transformation is executed, which removes some nodes, adds some nodes and changes some nodes from the graph.
|
|
|
3. The changed model is extracted from the transformation engine.
|
|
|
4. The map of EObjects of the initial model to their IDs, and the list of nodes of the first step is used to create a map of EObjects of the result model to the IDs.
|
|
|
|
|
|
![HenshinTransformationTask.execute](/uploads/6822d94f55e17b6373dba0b51ba3bbc1/HenshinTransformationTask.execute.png)
|
|
|
|
|
|
### IL <-> Architecture Model
|
|
|
Here, the same mechanism is used as in Implementation Model <-> IL.
|
|
|
### <a name="il2adl"></a>IL <-> Architecture Model
|
|
|
Here, the same mechanism is used as in [Implementation Model <-> IL](#ail2il).
|
|
|
|
|
|
![M2MTransformationComponentImpl.transformModel](/uploads/49bf4b656b1b1f490bfe02552fef762f/M2MTransformationComponentImpl.transformModel.png)
|
|
|
|
|
|
### End of Code -> Architecture
|
|
|
In the end, the TransformationManager keeps the last TransformationResult, that contains:
|
|
|
* the model roots
|
|
|
* the 4 maps (UUID, EObject) and (EObject, UUID) for the transformed IL model and the architecture model
|
|
|
* the map (Architecture Model UUID*, Transformed IL Model UUID*)
|
|
|
### <a name="end"></a>End of Code -> Architecture
|
|
|
In the end, the TransformationManager keeps:
|
|
|
|
|
|
* the ADL model roots
|
|
|
* the list of AIL to code transformation objects
|
|
|
* maps (UUID, EObject) and (EObject, UUID) for the ADL
|
|
|
* a map of IDs to the transformation objects
|
|
|
|
|
|
## Code <- Architecture
|
|
|
## <a name="arch2code"></a>Code <- Architecture
|
|
|
|
|
|
![Model_Integration](/uploads/643d57c92de2e9a2c6693d3fe75a85e4/Model_Integration.png)
|
|
|
|
... | ... | |