Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/user/org.eclipse.papyrus.examples.user.QVToExamples/MyTransfo.qvto')
-rw-r--r--examples/user/org.eclipse.papyrus.examples.user.QVToExamples/MyTransfo.qvto16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/user/org.eclipse.papyrus.examples.user.QVToExamples/MyTransfo.qvto b/examples/user/org.eclipse.papyrus.examples.user.QVToExamples/MyTransfo.qvto
new file mode 100644
index 00000000000..72ecc299a31
--- /dev/null
+++ b/examples/user/org.eclipse.papyrus.examples.user.QVToExamples/MyTransfo.qvto
@@ -0,0 +1,16 @@
+modeltype UML uses 'http://www.eclipse.org/uml2/3.0.0/UML';
+transformation MyTransformation(inout model : UML){
+
+ main() {
+ //Get the root of the model
+ var root := model.rootObjects()![UML::Model];
+ //Get all the classes in this model
+ var clazzes := model.objectsOfType(Class)->asSequence();
+
+ //Prefix all of them
+ clazzes->forEach(el){
+ el.name := "MySystem-"+el.name;
+ }
+ }
+
+} \ No newline at end of file

Back to the top