Skip to content

Commit 5e2ca87

Browse files
committed
Remove xmof specific code in TMM generation
1 parent c0ba1e8 commit 5e2ca87

4 files changed

Lines changed: 127 additions & 191 deletions

File tree

trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/src/fr/inria/diverse/trace/metamodel/generator/TraceMMGenerationTraceability.xtend

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,7 @@ class TraceMMGenerationTraceability {
254254
return mutablePropertyToValueProperty.get(mutableProperty)
255255
}
256256

257-
def EClassifier getRealMutableClass(EClassifier c) {
258-
if (xmofExeToConf.containsKey(c)) xmofExeToConf.get(c) else c
259-
}
260-
261-
public val Map<EClass,EClass> xmofExeToConf = new HashMap
262257

263-
def void addXmofExeToConf(EClass exe, EClass conf) {
264-
xmofExeToConf.put(exe,conf)
265-
}
266258

267259

268260

trace/generator/plugins/fr.inria.diverse.trace.metamodel.generator/src/fr/inria/diverse/trace/metamodel/generator/TraceMMGeneratorStates.xtend

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,11 @@ class TraceMMGeneratorStates {
137137
return result
138138
}
139139

140-
private def boolean isXmofConfClassOf(EClass c, EClass s) {
141-
if (c.name.endsWith("Configuration") && c.name.startsWith(s.name)) {
142-
traceability.addXmofExeToConf(s, c)
143-
return true
144-
}
145-
return false
146-
}
147140

148141
private def void getAllInheritance(Set<EClass> result, EClass c) {
149142
if (!result.contains(c)) {
150143
result.add(c)
151-
for (sup : c.ESuperTypes // TODO ugly fix to not include AS classes in the XMOF case, to remove at some point
152-
.filter[s|! isXmofConfClassOf(c, s)]) {
144+
for (sup : c.ESuperTypes) {
153145
getAllInheritance(result, sup)
154146
}
155147
for (sub : getSubTypesOf(c)) {
@@ -213,19 +205,17 @@ class TraceMMGeneratorStates {
213205

214206
private def EClass handleTraceClass(EClass runtimeClass) {
215207

216-
// If the xmof conf metamodel still has references to the AS, we replace by refs to the conf metamodel
217-
if (traceability.xmofExeToConf.containsKey(runtimeClass))
218-
return handleTraceClass(traceability.xmofExeToConf.get(runtimeClass))
219-
220208
if (!allRuntimeClasses.contains(runtimeClass))
221209
return runtimeClass
222210

223211
if (! runtimeToTraced.containsKey(runtimeClass)) {
212+
213+
val boolean hasDynamicProperties = runtimeClass.EAllStructuralFeatures.exists[f|mmext.dynamicProperties.contains(f)]
224214

225215
// Creating the traced version of the class
226216
val tracedClass = EcoreFactory.eINSTANCE.createEClass
227217
tracedClass.name = TraceMMStrings.class_createTraceClassName(runtimeClass)
228-
tracedClass.abstract = runtimeClass.abstract || runtimeClass.interface
218+
tracedClass.abstract = runtimeClass.abstract || runtimeClass.interface || !hasDynamicProperties
229219
runtimeToTraced.put(runtimeClass, tracedClass)
230220

231221
// Storing traceability stuff
@@ -279,17 +269,7 @@ class TraceMMGeneratorStates {
279269
traceability.addRefs_originalObject(tracedClass, ref)
280270
}
281271

282-
// // Link Trace class -> Traced class
283-
// if (!tracedClass.abstract) {
284-
// val refName = TraceMMStrings.ref_createTraceClassToTracedClass(tracedClass)
285-
// val refTraceClassToTracedClass = addReferenceToClass(traceMMExplorer.specificTraceClass, refName, tracedClass)
286-
// tracedClassGetters.add(EcoreCraftingUtil.stringGetter(refName))
287-
// refTraceClassToTracedClass.containment = true
288-
// refTraceClassToTracedClass.ordered = false
289-
// refTraceClassToTracedClass.unique = true
290-
// refTraceClassToTracedClass.upperBound = -1
291-
// refTraceClassToTracedClass.lowerBound = 0
292-
// }
272+
293273
// Then going through all properties for the remaining generation
294274
var Set<EStructuralFeature> runtimeProperties = new HashSet<EStructuralFeature>
295275
if (allNewEClasses.contains(runtimeClass))
@@ -298,11 +278,6 @@ class TraceMMGeneratorStates {
298278
if (!dynamicProperties.empty) {
299279
runtimeProperties.addAll(dynamicProperties);
300280
}
301-
// for (c2 : mmext.classesExtensions) {
302-
// if(c2.extendedExistingClass == runtimeClass) {
303-
// runtimeProperties.addAll(c2.newProperties)
304-
// }
305-
// }
306281
}
307282

308283
// Storing traceability stuff

0 commit comments

Comments
 (0)