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/03 17:00
on 2014/01/03 17:00
edited by Alexander Schulz-Rosengarten
on 2013/12/18 16:12
on 2013/12/18 16:12
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -2,15 +2,19 @@ 2 2 3 3 4 4 5 -=== Topics === 6 6 7 7 8 - 9 9 {{toc maxLevel="2" minLevel="2"/}} 10 10 9 +---- 10 + 11 +== Overview == 12 + 13 + 14 + 11 11 This subproject provides a tracing mechanism for arbitary model-elements across multiple model transformations, based on EMF. 12 12 13 -The main propose of KTM is to allow bidirectionalinformation 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. 14 14 15 15 ---- 16 16 ... ... @@ -22,151 +22,88 @@ 22 22 23 23 It is based on an EMF-Metamodel. 24 24 25 - [[image:attach:als-ktmt-metamodel.png]]29 + 26 26 27 - Thestructure of themodelcan be separated into two parts.31 +<metamodel> 28 28 29 - **Firstpart** (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.33 + 30 30 31 - **Second part** (lowerhalf) is object-mapping.Instancesof modelscontainEObjectsastheir elements, which are represented by Element-class in TransformationTree metamodel.The Elementsoftwomodels are connected with ElementTransformations-class to model their origination relationshipin corresponding model transformation.35 +The structure of the model can be separated into two parts. 32 32 33 - 37 +First part is a tree of transformations. 34 34 35 - Anabstractexample of an instance ofthismodel:39 +Each Model-Class is a representation of a concrete model which is transformed. So models are nodes and ModelTransformations are edges. 36 36 37 - [[image:attach:abstract_example_tree.png]]41 +Thus the Model representing the root-model of a tree is also the root of a concrete TransformationTree-Model. 38 38 39 - ----43 +Second part is object mapping. 40 40 41 - ==Extensions==45 +Concrete models contain EObjects as their elements, which are representend by Element-Class in TransformationTree metamodel. 42 42 43 -T woclassesareprovided by thisproject toextend functionalityofthe coremodel.47 +The Elements of two models are connected with ElementTransformations-Class to model their 44 44 45 - === TransformationMapping([[JavaDoc>>attach:TransformationMapping.html]]) ===49 +origination relationship in corresponding model transformation. 46 46 47 - Themain propose of this class is generation of a object-mapping during transformation process.51 + 48 48 49 - Thereforitprovidesdifferentfunctionsforincrementalregisteringofsingle parent-child-relationsbetween EObjects.53 +An abstract example of an instance of this model: 50 50 51 - Furthermore,the extension allows to extract the mapping and check completeness of mapped elements against content of transformed models.55 + 52 52 53 - === TransformationTreeExtensions ([[JavaDoc>>attach:TransformationTreeExtensions.html]]) ===57 +<exmaple_tree> 54 54 55 - This class provides all functionalities to easily traverse and search in a TransformationTree.59 +---- 56 56 57 - Furthermore,itallows to modify trees by creating, deleting or appending new transformationsand transformed models.61 +== Extensions == 58 58 59 - Additionallythis extension provides functionality to extract a concrete mapping between two arbitary model intances from a TransformationTree.63 + 60 60 61 - ----65 +Two classes are provided by this project to extend functionality of the core model. 62 62 63 - ==Implementation Details ==67 + 64 64 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 -* 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. 69 +TransformationMapping (JavaDoc) 68 68 69 - ----71 + 70 70 71 - ==Example==73 +The main propose of this class is generation of a Object mapping during transformation process. 72 72 73 - ===CreatingMappingduringTransformation===75 +Therefor it provides different functions for incremental registering of single parent child relations beween EObjects. 74 74 75 - Thefollowingcodeisa modifcationofthetranformation"SpiltTriggerandEffects"ofSCCharts.77 +Furthermore, the extension allows to extract the mapping and check completeness of mapped elements against content of transformed models. 76 76 77 -{{code title="Modified SCChart Transformation" theme="Eclipse" linenumbers="true" language="java" firstline="1" collapse="true"}} 78 -package de.cau.cs.kieler.ktm.test.transformations 79 + 79 79 80 -import com.google.inject.Inject 81 -import de.cau.cs.kieler.ktm.extensions.TransformationMapping 82 -import de.cau.cs.kieler.sccharts.Region 83 -import de.cau.cs.kieler.sccharts.Transition 84 -import de.cau.cs.kieler.sccharts.extensions.SCChartsExtension 85 -/** 86 - * @author als 87 - */ 88 -class SCChartTestTransformation { 89 - @Inject 90 - extension TransformationMapping 91 - @Inject 92 - extension SCChartsExtension 81 +TransformationTreeExtensions (JavaDoc) 93 93 94 - // -- Mapping Access 95 - def extractMapping() { 96 - extractMappingData; 97 - } 83 + 98 98 99 - //------------------------------------------------------------------------- 100 - //-- S P L I T T R A N S I T I O N -- 101 - //------------------------------------------------------------------------- 102 - // For every transition T that has both, a trigger and an effect do the following: 103 - // For every effect: 104 - // Create a conditional C and add it to the parent of T's source state S_src. 105 - // create a new true triggered immediate effect transition T_eff and move all effects of T to T_eff. 106 - // Set the T_eff to have T's target state. Set T to have the target C. 107 - // Add T_eff to C's outgoing transitions. 108 - def Region transformTriggerEffect(Region rootRegion) { 109 - // Clone the complete SCCharts region 110 - var targetRootRegion = rootRegion.mappedCopy; //NEW - mapping information (changed copy to mappedCopy) 111 - // Traverse all transitions 112 - for (targetTransition : targetRootRegion.getAllContainedTransitions) { 113 - targetTransition.transformTriggerEffect(targetRootRegion); 114 - } 115 - targetRootRegion; 116 - } 117 - def void transformTriggerEffect(Transition transition, Region targetRootRegion) { 118 - // Only apply this to transition that have both, a trigger and one or more effects 119 - if (((transition.trigger != null || !transition.immediate) && !transition.effects.nullOrEmpty) || transition.effects.size > 1) { 120 - val targetState = transition.targetState 121 - val parentRegion = targetState.parentRegion 122 - val transitionOriginalTarget = transition.targetState 123 - var Transition lastTransition = transition 124 - for (effect : transition.effects.immutableCopy) { 125 - val effectState = parentRegion.createState(targetState.id + effect.id) 126 - effectState.mapParents(transition.mappedParents); //NEW - mapping information 127 - effectState.setTypeConnector 128 - val effectTransition = createImmediateTransition.addEffect(effect) 129 - effectTransition.mapParents(transition.mappedParents); //NEW - mapping information 130 - effectTransition.setSourceState(effectState) 131 - lastTransition.setTargetState(effectState) 132 - lastTransition = effectTransition 133 - } 134 - lastTransition.setTargetState(transitionOriginalTarget) 135 - } 136 - } 137 -} 138 -{{/code}} 85 +This class proived all functionalities to easily traverse and search in a TransformationTree. 139 139 140 - ===CreateTransformationTreewithMapping===87 +Furthermore, it allows to modify trees by creating, deleting or appending new transformations and transformed models. 141 141 142 - Totest the transformation and mapping we will transform th following ABO-SCChart.89 + 143 143 144 - [[image:attach:example_abo.jpeg]]91 +---- 145 145 146 - Thefollowing code snipped performs the transformation on our ABO-example, extracts the mapping and creates a transformation tree.93 + 147 147 148 -{{code title="Transform and create TranformationTree" theme="Eclipse" linenumbers="true" language="java" firstline="1" collapse="true"}} 149 -aboSplitTE = transformation.transformTriggerEffect(abo); 95 +== Implementation Details == 150 150 151 -Model aboSplitTEModel = transformationTreeExtensions.initializeTransformationTree( 152 - transformation.extractMapping(), 153 - "splitTriggerEffect", 154 - abo, "ABO", 155 - aboSplitTE, "ABO-splitTriEff"); 97 + 156 156 157 -tranformationTree = transformationTreeExtensions.root(aboSplitTEModel); 158 -{{/code}} 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. 159 159 160 - Theresult of transformation is the following SCChart. ABO-splitTriEff.101 + 161 161 162 - [[image:attach:example_abo_splitTE.jpeg]]103 +Models in TransformationTrees may be transient. 163 163 164 - ResultingTransformationTree hasfollowingstructure.105 +This indicates that all references to EObjects in all Elements of the transient model are removed. 165 165 166 - [[image:attach:example_tree.jpeg]]107 +Thus these models can't be source of a new appended tranformation and can not be associated with it's orginal model. 167 167 168 - Furthermore theTransformationTreenowcontainsthe followingmappinginformation.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. 169 169 170 - [[image:attach:example_tree_transformation.jpeg]]111 +== Example == 171 171 172 - Here youcan see the effectof the transformationcausingthe transformationto split up.113 +coming soon
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -86515 631 +8651475 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/86515 63/Transformation Mapping (KTM)1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/8651475/Transformation Mapping (KTM)