Changes for page Transformation Mapping (KTM)
Last modified by Richard Kreissig on 2023/09/14 11:14
<
>
edited by Alexander Schulz-Rosengarten
on 2014/01/10 11:28
on 2014/01/10 11:28
edited by Alexander Schulz-Rosengarten
on 2014/01/03 17:00
on 2014/01/03 17:00
Change comment:
added example for Mapping and TransformationTree creation
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -26,9 +26,9 @@ 26 26 27 27 The structure of the model can be separated into two parts. 28 28 29 -**First part** (upper half) is a tree of transformations. Each Model Wrapper-class is a representation of a model which is transformed. SoModelWrapperare nodes and ModelTransformations are edges. Thus theWrapperrepresenting theinitial-source-model of alltransformationis also the root of a TransformationTree-model.29 +**First part** (upper half) is a tree of transformations. Each Model-class is a representation of a concrete model which is transformed. So models are nodes and ModelTransformations are edges. Thus the Model representing the root-model of a tree is also the root of a concrete TransformationTree-model. 30 30 31 -**Second part** (lower half) is object-mapping. Instances of models contain EObjects as their elements, which are represented by E ObjectWrapper-class in thismetamodel. TheObjectWrapperof two models are connected with EObjectTransformations-class to expresstheir origination relationship in corresponding model transformation.31 +**Second part** (lower half) is object-mapping. Instances of models contain EObjects as their elements, which are represented by Element-class in TransformationTree metamodel. The Elements of two models are connected with ElementTransformations-class to model their origination relationship in corresponding model transformation. 32 32 33 33 34 34 ... ... @@ -62,8 +62,8 @@ 62 62 63 63 == Implementation Details == 64 64 65 -* All references to EObjects in EObjectWrapperare 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.66 -* 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.65 +* 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 functions which will check for structural matching models. 66 +* 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 ObjectMapping. 67 67 * 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. 68 68 69 69 ---- ... ... @@ -76,6 +76,7 @@ 76 76 77 77 {{code title="Modified SCChart Transformation" theme="Eclipse" linenumbers="true" language="java" firstline="1" collapse="true"}} 78 78 package de.cau.cs.kieler.ktm.test.transformations 79 + 79 79 import com.google.inject.Inject 80 80 import de.cau.cs.kieler.ktm.extensions.TransformationMapping 81 81 import de.cau.cs.kieler.sccharts.Region ... ... @@ -89,10 +89,12 @@ 89 89 extension TransformationMapping 90 90 @Inject 91 91 extension SCChartsExtension 92 - // NEW - Mapping access delegation 93 + 94 + // -- Mapping Access 93 93 def extractMapping() { 94 94 extractMappingData; 95 95 } 98 + 96 96 //------------------------------------------------------------------------- 97 97 //-- S P L I T T R A N S I T I O N -- 98 98 //------------------------------------------------------------------------- ... ... @@ -103,7 +103,6 @@ 103 103 // Set the T_eff to have T's target state. Set T to have the target C. 104 104 // Add T_eff to C's outgoing transitions. 105 105 def Region transformTriggerEffect(Region rootRegion) { 106 - clearMapping; //NEW - clear previous mapping information to assure a single consistent mapping 107 107 // Clone the complete SCCharts region 108 108 var targetRootRegion = rootRegion.mappedCopy; //NEW - mapping information (changed copy to mappedCopy) 109 109 // Traverse all transitions ... ... @@ -110,18 +110,11 @@ 110 110 for (targetTransition : targetRootRegion.getAllContainedTransitions) { 111 111 targetTransition.transformTriggerEffect(targetRootRegion); 112 112 } 113 - //check if mapping is complete (only for test proposes) 114 - val diff = rootRegion.checkMappingCompleteness(targetRootRegion); 115 - if (diff.key.empty && diff.value.empty) { 116 - targetRootRegion; 117 - } else { 118 - null 119 - } 115 + targetRootRegion; 120 120 } 121 121 def void transformTriggerEffect(Transition transition, Region targetRootRegion) { 122 122 // Only apply this to transition that have both, a trigger and one or more effects 123 - if (((transition.trigger != null || !transition.immediate) && !transition.effects.nullOrEmpty) || 124 - transition.effects.size > 1) { 119 + if (((transition.trigger != null || !transition.immediate) && !transition.effects.nullOrEmpty) || transition.effects.size > 1) { 125 125 val targetState = transition.targetState 126 126 val parentRegion = targetState.parentRegion 127 127 val transitionOriginalTarget = transition.targetState ... ... @@ -156,13 +156,13 @@ 156 156 Model aboSplitTEModel = transformationTreeExtensions.initializeTransformationTree( 157 157 transformation.extractMapping(), 158 158 "splitTriggerEffect", 159 - abo, " coreSCChart",160 - aboSplitTE, " coreSCChart-splitTriggerEffect");154 + abo, "ABO", 155 + aboSplitTE, "ABO-splitTriEff"); 161 161 162 162 tranformationTree = transformationTreeExtensions.root(aboSplitTEModel); 163 163 {{/code}} 164 164 165 -The result of transformation is the following SCChart. ABO-splitTri ggerEffect.160 +The result of transformation is the following SCChart. ABO-splitTriEff. 166 166 167 167 [[image:attach:example_abo_splitTE.jpeg]] 168 168 ... ... @@ -175,5 +175,3 @@ 175 175 [[image:attach:example_tree_transformation.jpeg]] 176 176 177 177 Here you can see the effect of the transformation causing the transformation to split up. 178 - 179 -[[image:attach:als-ktm-splitTriggerEffect-detail.jpg]]
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -86515 941 +8651563 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/86515 94/Transformation Mapping (KTM)1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/8651563/Transformation Mapping (KTM)