Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/user/org.eclipse.papyrus.examples.user.qvto/src/main/resources/models/MyTransfo.qvto')
-rw-r--r--examples/user/org.eclipse.papyrus.examples.user.qvto/src/main/resources/models/MyTransfo.qvto30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/user/org.eclipse.papyrus.examples.user.qvto/src/main/resources/models/MyTransfo.qvto b/examples/user/org.eclipse.papyrus.examples.user.qvto/src/main/resources/models/MyTransfo.qvto
new file mode 100644
index 00000000000..5b4ec6c70dd
--- /dev/null
+++ b/examples/user/org.eclipse.papyrus.examples.user.qvto/src/main/resources/models/MyTransfo.qvto
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Le Fevre (CEA LIST) francois.le-fevre@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+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