The id mapping requires the code elements as input. First, an architecture implementation model (AIL) is exracted from the code. This extraction has four results:
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.
A map of IDs to transformation objects
A list of AIL EObjects.
A map of AIL EObjects to their IDs.
In the next steps of the translation process, 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.
At last, the id mapping of the model extraction process exports:
A list of transformations from the AIL to the Code
A map of IDs to EObjects of the AIL
A list of EObjects of the ADL
A map of EObjects of the ADL to their IDs.
A map of IDs from AIL EObjects to ADL EObjects.
Code to Implementation Model
In the perspective of the ID mapping, the extraction process has 3 steps.
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.
Implementation Model to 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:
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.
Then it executs the transformation, thereby creating a list of TNodes for the initial graph, the result graph, and the correspondence graph.
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.
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.
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.
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.
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.
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:
The initial model is imported into the transformation engine. This creates a list of Graph Nodes that represent the EObjects.
The transformation is executed, which removes some nodes, adds some nodes and changes some nodes from the graph.
The changed model is extracted from the transformation engine.
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.