<
From version < 17.1 >
edited by Alexander Schulz-Rosengarten
on 2015/10/08 10:35
To version < 6.1 >
edited by Alexander Schulz-Rosengarten
on 2013/12/18 16:12
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,20 +1,20 @@
1 1  = KTM - KIELER Transformation Mapping =
2 2  
3 -{{panel bgColor="orange" title="DEPRECATED"}}
4 -This article is deprecated. KTM was redesigned is now available as KiTT. The documentation will be updated eventually.
5 -{{/panel}}
6 -
7 7  
8 8  
9 -=== Topics ===
10 10  
11 11  
12 -
13 13  {{toc maxLevel="2" minLevel="2"/}}
14 14  
9 +----
10 +
11 +== Overview ==
12 +
13 +
14 +
15 15  This subproject provides a tracing mechanism for arbitary model-elements across multiple model transformations, based on EMF.
16 16  
17 -The main propose of KTM is to allow bidirectional information transfer between abstract models and their resultant transformed models.
17 +The main propose of KTM is to allow information transfer between abstract models and their resultant transformed models.
18 18  
19 19  ----
20 20  
... ... @@ -26,239 +26,88 @@
26 26  
27 27  It is based on an EMF-Metamodel.
28 28  
29 -[[image:attach:als-ktmt-metamodel.png]]
29 +
30 30  
31 -The structure of the model can be separated into two parts.
31 +<metamodel>
32 32  
33 -**First part** (upper half) is a tree of transformations. Each ModelWrapper-class is a representation of a model which is transformed. So ModelWrapper are nodes and ModelTransformations are edges. Thus the ModelWrapper representing the initial-source-model of all transformation is also the root of a TransformationTree-model.
34 -
35 -**Second part** (lower half) is object-mapping. Instances of models contain EObjects as their elements, which are represented by EObjectWrapper-class in this metamodel. The EObjectWrapper of two models are connected with EObjectTransformations-class to express their origination relationship in corresponding model transformation.
36 -
37 37  
38 38  
39 -An abstract example of an instance of this model:
35 +The structure of the model can be separated into two parts.
40 40  
41 -[[image:attach:abstract_example_tree.png]]
37 +First part is a tree of transformations.
42 42  
43 -----
39 +Each Model-Class is a representation of a concrete model which is transformed. So models are nodes and ModelTransformations are edges.
44 44  
45 -== Extensions ==
41 +Thus the Model representing the root-model of a tree is also the root of a concrete TransformationTree-Model.
46 46  
47 -Two classes are provided by this project to extend functionality of the core model.
43 +Second part is object mapping.
48 48  
49 -=== TransformationMapping ([[JavaDoc>>attach:TransformationMapping.html]]) ===
45 +Concrete models contain EObjects as their elements, which are representend by Element-Class in TransformationTree metamodel.
50 50  
51 -The main propose of this class is generation of a object-mapping during transformation process.
47 +The Elements of two models are connected with ElementTransformations-Class to model their
52 52  
53 -Therefor it provides different functions for incremental registering of single parent-child-relations between EObjects.
49 +origination relationship in corresponding model transformation.
54 54  
55 -Furthermore, the extension allows to extract the mapping and check completeness of mapped elements against content of transformed models.
51 +
56 56  
57 -=== TransformationTreeExtensions ([[JavaDoc>>attach:TransformationTreeExtensions.html]]) ===
53 +An abstract example of an instance of this model:
58 58  
59 -This class provides all functionalities to easily traverse and search in a TransformationTree.
55 +
60 60  
61 -Furthermore, it allows to modify trees by creating, deleting or appending new transformations and transformed models.
57 +<exmaple_tree>
62 62  
63 -Additionally this extension provides functionality to extract a concrete mapping between two arbitary model intances from a TransformationTree.
64 -
65 65  ----
66 66  
67 -== Implementation Details ==
61 +== Extensions ==
68 68  
69 -* All references to EObjects in EObjectWrapper are references to a copy of the original EObject. This allows to represent immutable mapping. To reidentify corresponding EObjects TransformationTreeExtensions provides search functions which will check for structural matching models.
70 -* Models in TransformationTrees may be transient. This indicates that all references to EObjects in all Elements of the transient model are removed. Thus these models can't be source of a new appended transformation and can not be associated with it's original model. The main propose of this feature is to improve scalability of TransformationTrees by removing unnecessary references to internal model, but preserve traversing functionality of the object-mapping.
71 -* Mappings can be incomplete causing resulting transfromation tree to be incomplete. A incomplete tree does not represent every object in a model with a corresponding Element. This may break some paths of element transformations, but allows to omit model-immanent objects like annotations from mapping. TranformationMapping extension provies a function to check completeness of mapping against its models.
63 +
72 72  
73 -----
65 +Two classes are provided by this project to extend functionality of the core model.
74 74  
75 -== Example ==
76 -
77 -In this example we will perform some transformations on SCCharts.
78 -
79 -The source chart is a ABO, the "Hello World" of SCCharts.
80 -
81 -ABO is already a CoreSCChart, so we will perform normalization and a transformation to SCG.
82 -
83 -=== Creating Mapping during Transformation ===
84 -
85 -In order to note every single element transformation of a model transformation, we use the TransformationMapping extension.
86 -
87 -After each creation of new Objects for transformed model the mapping must be updated with it's origin information.
88 -
89 -The codeblock blow show a snipped of SCChartCoreTransformation with additional mapping registration.
90 -
91 91  
92 92  
93 -{{code title="transformTriggerEffect CodeSnipped" theme="Eclipse" linenumbers="true" language="java" firstline="1" collapse="true"}}
94 -...
95 -  @Inject
96 - extension TransformationMapping
69 +TransformationMapping (JavaDoc)
97 97  
98 -...
99 -
100 - // NEW - Mapping access delegation
101 - def extractMapping() {
102 - extractMappingData;
103 - }
104 -
105 -...
106 -
107 - //-------------------------------------------------------------------------
108 - //-- S P L I T T R A N S I T I O N --
109 - //-------------------------------------------------------------------------
110 - // For every transition T that has both, a trigger and an effect do the following:
111 - // For every effect:
112 - // Create a conditional C and add it to the parent of T's source state S_src.
113 - // create a new true triggered immediate effect transition T_eff and move all effects of T to T_eff.
114 - // Set the T_eff to have T's target state. Set T to have the target C.
115 - // Add T_eff to C's outgoing transitions.
116 - def Region transformTriggerEffect(Region rootRegion) {
117 - clearMapping; //NEW - clear previous mapping information to assure a single consistent mapping
118 - // Clone the complete SCCharts region
119 - var targetRootRegion = rootRegion.mappedCopy; //NEW - mapping information (changed copy to mappedCopy)
120 - // Traverse all transitions
121 - for (targetTransition : targetRootRegion.getAllContainedTransitions) {
122 - targetTransition.transformTriggerEffect(targetRootRegion);
123 - }
124 - val completeness = checkMappingCompleteness(rootRegion, targetRootRegion); //NEW - DEBUG
125 - targetRootRegion;
126 - }
127 - def void transformTriggerEffect(Transition transition, Region targetRootRegion) {
128 - // Only apply this to transition that have both, a trigger (or is a termination) and one or more effects
129 - if (((transition.trigger != null || !transition.immediate || transition.typeTermination) && !transition.effects.nullOrEmpty) ||
130 - transition.effects.size > 1) {
131 - val targetState = transition.targetState
132 - val parentRegion = targetState.parentRegion
133 - val transitionOriginalTarget = transition.targetState
134 - var Transition lastTransition = transition
135 - val firstEffect = transition.effects.head
136 - for (effect : transition.effects.immutableCopy) {
137 - // Optimization: Prevent transitions without a trigger
138 - if(transition.immediate && transition.trigger == null && firstEffect == effect) {
139 - // skip
140 - } else {
141 - val effectState = parentRegion.createState(GENERATED_PREFIX + "S")
142 - effectState.mapParents(transition.mappedParents); //NEW - mapping information
143 - effectState.uniqueName
144 - val effectTransition = createImmediateTransition.addEffect(effect)
145 - effectTransition.mapParents(transition.mappedParents); //NEW - mapping information
146 -
147 - effectTransition.setSourceState(effectState)
148 - lastTransition.setTargetState(effectState)
149 - lastTransition = effectTransition
150 - }
151 - }
152 - lastTransition.setTargetState(transitionOriginalTarget)
153 - }
154 - }
155 -{{/code}}
156 -
157 -=== Create TransformationTree ===
158 -
159 -The following code will now perform each transformation stepwise and updates a transformation tree each step.
160 -
161 161  
162 162  
163 -{{code title="Transform and create TranformationTree" theme="Eclipse" linenumbers="true" language="java" firstline="1" collapse="true"}}
164 -aboSplitTE = SCCtransformation.transformTriggerEffect(abo);
73 +The main propose of this class is generation of a Object mapping during transformation process.
165 165  
166 -ModelWrapper aboSplitTEModel =
167 - transformationTree.initializeTransformationTree(SCCtransformation.extractMapping(), "TriggerEffect", abo, "coreSCChart", aboSplitTE, "coreSCChart-splitTriggerEffect");
75 +Therefor it provides different functions for incremental registering of single parent child relations beween EObjects.
168 168  
169 -aboNormalized = SCCtransformation.transformSurfaceDepth(aboSplitTE);
77 +Furthermore, the extension allows to extract the mapping and check completeness of mapped elements against content of transformed models.
170 170  
171 -ModelWrapper aboNormalizedModel =
172 - transformationTree.addTransformationToTree(SCCtransformation.extractMapping(), aboSplitTEModel, "SurfaceDepth", aboSplitTE, aboNormalized, "normalizedCoreSCChart");
173 -
174 -aboSCG = SCGtransformation.transformSCG(aboNormalized);
175 -
176 -ModelWrapper aboSCGModel =
177 - transformationTree.addTransformationToTree(SCGtransformation.extractMapping(), aboNormalizedModel, "SCC2SCG", aboNormalized, aboSCG,"SCG");
178 -
179 -tree = transformationTree.root(aboSCGModel);
180 -{{/code}}
181 -
182 182  
183 183  
184 -The resulting TransformationTree has following structure and representing each step and model of the transformation.
81 +TransformationTreeExtensions (JavaDoc)
185 185  
186 186  
187 187  
188 -|=(% colspan="4" style="text-align: center;" %)(% colspan="4" style="text-align: center;" %)
189 -(((
190 -[[image:attach:example_tree.jpeg]]
191 -)))
192 -|(% colspan="1" style="text-align: center;" %)(% colspan="1" style="text-align: center;" %)
193 -(((
194 -[[image:attach:example_abo.jpeg]]
195 -)))|(% colspan="1" style="text-align: center;" %)(% colspan="1" style="text-align: center;" %)
196 -(((
197 -[[image:attach:example_abo_splitTE.jpeg]]
198 -)))|(% colspan="1" style="text-align: center;" %)(% colspan="1" style="text-align: center;" %)
199 -(((
200 -[[image:attach:example_abo_norm.jpeg]]
201 -)))|(% colspan="1" style="text-align: center;" %)(% colspan="1" style="text-align: center;" %)
202 -(((
203 -[[image:attach:example_abo_scg.jpeg]]
204 -)))
85 +This class proived all functionalities to easily traverse and search in a TransformationTree.
205 205  
206 -
87 +Furthermore, it allows to modify trees by creating, deleting or appending new transformations and transformed models.
207 207  
208 -Furthermore the TransformationTree now contains mapping information for the whole transformation chain.
209 -
210 -Now we can use an additional feature of KTM, the resolving of mappings between arbitary models.
211 -
212 -The following code has starts with an instance of the initial ABO SCChart and SCG, along with the TranformationTree above.
213 -
214 214  
215 215  
216 -{{code title="resolveMapping" theme="Eclipse" linenumbers="true" language="java" firstline="1" collapse="true"}}
217 -@Inject
218 -extension TransformationTreeExtensions
91 +----
219 219  
220 -//Find nodes of model instances in tree
221 -val aboSCCModelWrapper = transformationTree.findModel(aboSCC,"coreSCChart");
222 -val aboSCGModelWrapper = transformationTree.findModel(aboSCG,"SCG");
223 -
224 -//resolve
225 -val mapping = resolvemapping(aboSCCModelWrapper, aboSCC, aboSCGModelWrapper, aboSCG);
226 -{{/code}}
227 -
228 228  
229 229  
230 -The returned mapping is a multi mapping between all object in aboSCC and their resulting objects in aboSCG.
95 +== Implementation Details ==
231 231  
232 -This mapping can now displayed in models or used for various information propagation between elements of the models.
233 -
234 -[[image:attach:example_abo_resolved.jpeg]]
235 -
236 236  
237 237  
238 -Also a more detailed view is available, showing all EObjects relation.
99 +All references to EObjects are references to a copy of the original EObject. This allows to represent immutable mapping. To reidentify corresponding EObjects TransformationTreeExtensions provides search funtions and matching functionality.
239 239  
240 240  
241 241  
242 -[[image:attach:example_abo_resolved_elements.jpeg]]
103 +Models in TransformationTrees may be transient.
243 243  
244 -== Visualisation ==
105 +This indicates that all references to EObjects in all Elements of the transient model are removed.
245 245  
246 -If you have a TransformationTree file (.ktmt) you can open a KLighD visualisation by right-clicking on file in project-tree and selecting //'Open Transformation Tree//'.
107 +Thus these models can't be source of a new appended tranformation and can not be associated with it's orginal model.
247 247  
248 -=== Diagram Options ===
109 +The main propose of this feature is to improve scalability of TransformationTrees by removing unneccessary references to internal model, but preserve traversing funtionality of the ObjectMapping.
249 249  
250 -//Model Visualisation//: If enabled tries to visaulize selected models with KLighD else a EObject-represenation is created.
111 +== Example ==
251 251  
252 -//EObject Attributes//: If enabled shows Attributes of EObject in EObject-represenation.
253 -
254 -//Selective mapping edges//: If enabled shows only selected mapping edges.
255 -
256 -=== Interaction ===
257 -
258 -//CTRL+CLICK//: Selects a Node in TransformationTree as source and displays its represented model.
259 -
260 -//SHIFT+CLICK//: Selects a Node in TransformationTree as target, displays both models and the resolved mapping as edges (currenly only between States/Regions).
261 -
262 -If Selective selective mapping edge is enabled no mapping edges are displayed. If you select (//CLICK//) an element in one of the two model its relation to corresponding element is displayed. You can multi-select with //CTRL+CLICK// or deselect by clicking on an edge.
263 -
264 -
113 +coming soon
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -50823215
1 +8651475
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/50823215/Transformation Mapping (KTM)
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/8651475/Transformation Mapping (KTM)