| modeltype ECORE uses "http://www.eclipse.org/emf/2002/Ecore"; |
| modeltype UML uses "http://www.eclipse.org/qvt/1.0.0/Operational/examples/simpleuml"; |
| |
| transformation ecore2uml_(in ecore : ECORE, out UML); |
| |
| configuration property prop : String; |
| |
| mapping main(out umlCls : Class) { |
| init { |
| umlCls := ecore.objects()->select(c|c.oclIsKindOf(EClass)) |
| ->any(true).oclAsType(EClass).map toUmlClass(); |
| |
| umlCls.attributes += object Property { name := prop }; |
| } |
| } |
| |
| mapping EClass::toUmlClass() : Class { |
| name := self.name + '_uml' |
| } |