Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2014-12-16 22:06:02 +0000
committerEd Willink2014-12-16 22:06:02 +0000
commit304ae3fc333caee54f9d07749f5c7d7ee113d0f4 (patch)
tree869f445d12e89fdb3ff6022f8e34e3def80e9cd3 /examples
parent8da58e0adedfcf8b33052b193a3587283d12bc56 (diff)
parentfb8a10e838237ee989606be27fa336f0a1ae4b2a (diff)
downloadorg.eclipse.qvtd-304ae3fc333caee54f9d07749f5c7d7ee113d0f4.tar.gz
org.eclipse.qvtd-304ae3fc333caee54f9d07749f5c7d7ee113d0f4.tar.xz
org.eclipse.qvtd-304ae3fc333caee54f9d07749f5c7d7ee113d0f4.zip
Merge remote-tracking branch 'origin/hhoyos/qvtr' into ewillink/ocl25
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.classpath2
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.project6
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.settings/org.eclipse.jdt.core.prefs5
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/META-INF/MANIFEST.MF3
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/Readme.txt8
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/build.properties3
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/AbtractToConcrete.qvtc103
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/ClassAbstractToConcrete.ecore29
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/ClassMM_IN.emof24
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/HstmToStm.mwe232
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/HstmToStm.mwe2.launch14
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmMM.emof47
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmMM.xml36
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmUM.xml24
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmtostm.qvt82
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmtostm.qvtr85
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmMM.emof43
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmMM.xml32
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmUM.xml39
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/MetamodelEntry.java43
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/ModelEntry.java52
-rw-r--r--examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/ModelMorfComponent.java298
22 files changed, 990 insertions, 20 deletions
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.classpath b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.classpath
index 6003f2b92..5d8a76332 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.classpath
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.classpath
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry excluding="**" kind="src" output="qvtrbin" path="qvtrsrc"/>
+ <classpathentry kind="src" output="qvtrbin" path="qvtrsrc"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.project b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.project
index a4fda5661..76ed06c03 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.project
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.project
@@ -6,6 +6,11 @@
</projects>
<buildSpec>
<buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
@@ -13,5 +18,6 @@
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.settings/org.eclipse.jdt.core.prefs
index af0f20f97..eb1cb4cf9 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/META-INF/MANIFEST.MF b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/META-INF/MANIFEST.MF
index c3f2ef625..ef97a36be 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/META-INF/MANIFEST.MF
@@ -6,3 +6,6 @@ Bundle-Version: 1.0.0.qualifier
Export-Package: org.eclipse.qvtd.examples.qvtrelation.modelmorf
Bundle-Vendor: Eclipse Modeling Project
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.emf.mwe2.runtime;bundle-version="2.7.0",
+ org.eclipse.emf.mwe2.launch;bundle-version="2.7.0",
+ org.apache.log4j;bundle-version="1.2.15"
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/Readme.txt b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/Readme.txt
new file mode 100644
index 000000000..c71a425c9
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/Readme.txt
@@ -0,0 +1,8 @@
+- You need to get a copy of ModelMorf and have a valid licence. Download links and licence information can be found here: http://www.tcs-trddc.com/trddc_website/ModelMorf/ModelMorf.htm
+- You need to create two substition strings in your Eclipse (Windows->Preferences->Run/Debug->String Substitution)
+ - java_15: Should point to the java.exe of a Java 1.5 32-bit JVM executable.
+ - modelmorf: Should point to your ModelMorf installation path (i.e. C:\ModelMorf).
+- The workspace or git repository where the plugins exists can not have spaces in the path.
+- The *.qvt file is a copy of the *.qvtr file with some minor modifications due to syntax differences between ModelMorf and Eclipse QVTd concrete syntax. Hence, if you want to modify the source, recommended approach is to do it in the *.qvtr file to take advantage of error highlighting and type resolution and then copy the changes to the *.qvt file.
+- ModelMorf requires that all metamodels and models are *.xml files. Read "Modeling with EMF Editor.pdf" in your ModelMorf /Examples folder for a guide on how to get the xml files from Ecore and XMI files.
+ \ No newline at end of file
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/build.properties b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/build.properties
index 4d87a2ed0..551a7882e 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/build.properties
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/build.properties
@@ -8,7 +8,8 @@
# Contributors:
# E.D.Willink - initial API and implementation
###############################################################################
-source.. = src/
+source.. = src/,\
+ qvtsrc/
output.. = bin/
bin.includes = META-INF/,\
.,\
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/AbtractToConcrete.qvtc b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/AbtractToConcrete.qvtc
new file mode 100644
index 000000000..dad448448
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/AbtractToConcrete.qvtc
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2007,2008 Tata Consultancy Services and others.
+ * 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:
+ * TCS - initial implementation for ModelMorf
+ * E.D.Willink - alignment with evolved specification
+ *******************************************************************************/
+import UMLMM : 'ClassMM_IN.emof'::ClassMM;
+import ABS2CONC : 'ClassAbstractToConcrete.ecore'::abs2conc;
+
+transformation AbstractToConcrete {
+ uml1 imports UMLMM;
+ uml2 imports UMLMM;
+ imports ABS2CONC;
+}
+
+map AbstractClassToConcreteClass in AbstractToConcrete {
+ uml1 (cc1 : Class, ac : Class |
+ cc1.inheritsFrom = ac;
+ ac.isAbstract;)
+ {
+
+ }
+ enforce uml2 ()
+ {
+ realize cc2 : Class |
+ }
+ where () {
+ realize p2c : ParentToChild |
+ p2c.parent := ac;
+ p2c.class2 := cc2;
+ }
+}
+
+map OperationToOperation in AbstractToConcrete {
+ uml1 (pc : Class, aco:Operation |
+ pc.isAbstract;
+ aco.class = pc;)
+ {
+
+ }
+ enforce uml2 (cc2 : Class | )
+ {
+ realize cco:Operation |
+ cco.class := cc2;
+ }
+ where (p2c : ParentToChild |
+ p2c.parent = pc;
+ p2c.class2 = cc2;)
+ {
+ realize o2o : OperationToOperation |
+ o2o.op1 := aco;
+ o2o.op2 := cco;
+ o2o.class := p2c;
+ }
+ map
+ {
+ where() {
+ o2o.name := aco.name;
+ o2o.name := cco.name;
+ aco.name := o2o.name;
+ cco.name := o2o.name;
+ }
+ }
+}
+
+map ParameterToParameter in AbstractToConcrete {
+ uml1 (aco:Operation, acop:Parameter |)
+ {
+ acop.operation = aco;
+ }
+ uml2 (cco:Operation, ccop:Parameter |)
+ {
+ ccop.operation = cco;
+ }
+ where (o2o : OperationToOperation |
+ o2o.op1 = aco;
+ o2o.op2 = cco;)
+ {
+ realize p2p : ParameterToParameter |
+ p2p.param1 := acop;
+ p2p.param2 := ccop;
+ p2p.operation := o2o;
+ }
+ map
+ {
+ where ()
+ {
+ p2p.name := acop.name;
+ p2p.name := ccop.name;
+ acop.name := p2p.name;
+ ccop.name := p2p.name;
+ p2p.type := acop.type;
+ p2p.type := ccop.type;
+ acop.type := p2p.type;
+ ccop.type := p2p.type;
+ }
+ }
+}
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/ClassAbstractToConcrete.ecore b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/ClassAbstractToConcrete.ecore
new file mode 100644
index 000000000..97af561c9
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/ClassAbstractToConcrete.ecore
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="abs2conc" nsURI="ClassAbstractToConcrete" nsPrefix="abs2conc">
+ <eAnnotations source="http://www.eclipse.org/OCL/Import">
+ <details key="classMM" value="ClassMM_IN.emof#ClassMM"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="ParentToChild">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="operations" upperBound="-1"
+ eType="#//OperationToOperation" eOpposite="#//OperationToOperation/class"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="ecore:EClass ClassMM_IN.emof#ClassMM.Class"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="class2" eType="ecore:EClass ClassMM_IN.emof#ClassMM.Class"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="OperationToOperation">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="op1" eType="ecore:EClass ClassMM_IN.emof#ClassMM.Operation"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="op2" eType="ecore:EClass ClassMM_IN.emof#ClassMM.Operation"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="class" eType="#//ParentToChild"
+ eOpposite="#//ParentToChild/operations"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="parameters" upperBound="-1"
+ eType="#//ParameterToParameter"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ParameterToParameter">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="param1" eType="ecore:EClass ClassMM_IN.emof#ClassMM.Parameter"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="param2" eType="ecore:EClass ClassMM_IN.emof#ClassMM.Parameter"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="ecore:EClass ClassMM_IN.emof#ClassMM.Type"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="operation" eType="#//OperationToOperation"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/ClassMM_IN.emof b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/ClassMM_IN.emof
index d3ea36d49..ec0f59d57 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/ClassMM_IN.emof
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/AbstractToConcrete/ClassMM_IN.emof
@@ -1,18 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (c) 2007,2008 Tata Consultancy Services and others.
- * 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:
- * TCS - initial implementation for ModelMorf
- * E.D.Willink - alignment with evolved specification
--->
-<emof:Package xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:emof="http://schema.omg.org/spec/MOF/2.0/emof.xml" xmi:id="ClassMM"
- name="ClassMM" uri="ClassMM">
+<emof:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:emof="http://schema.omg.org/spec/MOF/2.0/emof.xml"
+ xmi:id="ClassMM" name="ClassMM" uri="ClassMM">
<ownedType xmi:type="emof:Class" xmi:id="ClassMM.dummy" name="dummy">
<ownedAttribute xmi:id="ClassMM.dummy.hasType" name="hasType" upper="*" type="ClassMM.Type"
isComposite="true"/>
@@ -34,7 +22,7 @@
<ownedAttribute xmi:id="ClassMM.Operation.name" name="name">
<type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/MOF/2.0/emof.xml#String"/>
</ownedAttribute>
- <ownedAttribute xmi:id="ClassMM.Operation.class" name="class" lower="1" type="ClassMM.Class"
+ <ownedAttribute xmi:id="ClassMM.Operation.class" name="class" type="ClassMM.Class"
opposite="ClassMM.Class.operation"/>
<ownedAttribute xmi:id="ClassMM.Operation.parameter" name="parameter" upper="*"
type="ClassMM.Parameter" isComposite="true" opposite="ClassMM.Parameter.operation"/>
@@ -43,9 +31,9 @@
<ownedAttribute xmi:id="ClassMM.Parameter.name" name="name">
<type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/MOF/2.0/emof.xml#String"/>
</ownedAttribute>
- <ownedAttribute xmi:id="ClassMM.Parameter.type" name="type" lower="1" type="ClassMM.Type"/>
- <ownedAttribute xmi:id="ClassMM.Parameter.operation" name="operation" lower="1"
- type="ClassMM.Operation" opposite="ClassMM.Operation.parameter"/>
+ <ownedAttribute xmi:id="ClassMM.Parameter.type" name="type" type="ClassMM.Type"/>
+ <ownedAttribute xmi:id="ClassMM.Parameter.operation" name="operation" type="ClassMM.Operation"
+ opposite="ClassMM.Operation.parameter"/>
</ownedType>
<ownedType xmi:type="emof:Class" xmi:id="ClassMM.PrimitiveDataType" name="PrimitiveDataType"
superClass="ClassMM.Type"/>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/HstmToStm.mwe2 b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/HstmToStm.mwe2
new file mode 100644
index 000000000..7e3fd370a
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/HstmToStm.mwe2
@@ -0,0 +1,32 @@
+module org.eclipse.qvtd.examples.qvtrelation.modelmorf.hstmtostm.HstmToStm
+
+import java.util.*
+
+import org.eclipse.qvtd.examples.qvtrelation.modelmorf.ModelMorfComponent
+
+Workflow {
+ component = ModelMorfComponent {
+ java15Path = "C:\\ModelMorf\\Java\\jdk1.5\\bin"
+ modelMorfPath = "C:\\ModelMorf"
+ metamodel = {
+ alias = "hstmMM_p"
+ file = "hstmMM.xml"
+ }
+ metamodel = {
+ alias = "stmMM_p"
+ file = "stmMM.xml"
+ }
+ qvtSpecificationFile = "hstmtostm.qvt"
+ model = {
+ variable = "hstm"
+ file = "hstmUM.xml"
+ }
+ model = {
+ variable = "stm"
+ file = "stmUM.xml"
+ }
+ transformationName = "HstmToStm"
+ directionDomain = "stm"
+ domainQualifier = "enforce"
+ }
+} \ No newline at end of file
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/HstmToStm.mwe2.launch b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/HstmToStm.mwe2.launch
new file mode 100644
index 000000000..cc53f4f89
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/HstmToStm.mwe2.launch
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.emf.mwe2.launch.Mwe2LaunchConfigurationType">
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.qvtd.examples.qvtrelation.modelmorf"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/HstmToStm.mwe2"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.qvtd.examples.qvtrelation.modelmorf"/>
+</launchConfiguration>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmMM.emof b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmMM.emof
new file mode 100644
index 000000000..960a4b27c
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmMM.emof
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2007,2008 Tata Consultancy Services and others.
+ * 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:
+ * TCS - initial implementation for ModelMorf
+ * E.D.Willink - alignment with evolved specification
+-->
+<emof:Package xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:emof="http://schema.omg.org/spec/MOF/2.0/emof.xml" xmi:id="hstmMM_p"
+ name="hstmMM_p" uri="hstmMM_p">
+ <ownedType xmi:type="emof:Class" xmi:id="hstmMM_p.State" name="State">
+ <ownedAttribute xmi:id="hstmMM_p.State.containsState" name="containsState" upper="*"
+ type="hstmMM_p.State" opposite="hstmMM_p.State.containedInState"/>
+ <ownedAttribute xmi:id="hstmMM_p.State.containedInState" name="containedInState"
+ type="hstmMM_p.State" opposite="hstmMM_p.State.containsState"/>
+ <ownedAttribute xmi:id="hstmMM_p.State.outTrans" name="outTrans" upper="*" type="hstmMM_p.Trans"
+ opposite="hstmMM_p.Trans.fromState"/>
+ <ownedAttribute xmi:id="hstmMM_p.State.inTrans" name="inTrans" upper="*" type="hstmMM_p.Trans"
+ opposite="hstmMM_p.Trans.toState"/>
+ <ownedAttribute xmi:id="hstmMM_p.State.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/MOF/2.0/emof.xml#String"/>
+ </ownedAttribute>
+ </ownedType>
+ <ownedType xmi:type="emof:Class" xmi:id="hstmMM_p.Trans" name="Trans">
+ <ownedAttribute xmi:id="hstmMM_p.Trans.fromState" name="fromState" lower="1" type="hstmMM_p.State"
+ opposite="hstmMM_p.State.outTrans"/>
+ <ownedAttribute xmi:id="hstmMM_p.Trans.toState" name="toState" lower="1" type="hstmMM_p.State"
+ opposite="hstmMM_p.State.inTrans"/>
+ <ownedAttribute xmi:id="hstmMM_p.Trans.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/MOF/2.0/emof.xml#String"/>
+ </ownedAttribute>
+ </ownedType>
+ <ownedType xmi:type="emof:Class" xmi:id="hstmMM_p.dummy" name="dummy">
+ <ownedAttribute xmi:id="hstmMM_p.dummy.contains_state" name="contains_state" upper="*"
+ type="hstmMM_p.State" isComposite="true"/>
+ <ownedAttribute xmi:id="hstmMM_p.dummy.conatains_trans" name="conatains_trans"
+ upper="*" type="hstmMM_p.Trans" isComposite="true"/>
+ <ownedAttribute xmi:id="hstmMM_p.dummy.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/MOF/2.0/emof.xml#String"/>
+ </ownedAttribute>
+ </ownedType>
+</emof:Package>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmMM.xml b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmMM.xml
new file mode 100644
index 000000000..ef158d408
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmMM.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<emof:Package xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:emof="http://schema.omg.org/spec/mof/2.0/emof.xmi" xmi:id="hstmMM_p"
+ name="hstmMM_p" uri="hstmMM_p">
+ <ownedType xmi:type="emof:Class" xmi:id="hstmMM_p.State" name="State">
+ <ownedAttribute xmi:id="hstmMM_p.State.containsState" name="containsState" upper="*"
+ type="hstmMM_p.State" opposite="hstmMM_p.State.containedInState"/>
+ <ownedAttribute xmi:id="hstmMM_p.State.containedInState" name="containedInState"
+ type="hstmMM_p.State" opposite="hstmMM_p.State.containsState"/>
+ <ownedAttribute xmi:id="hstmMM_p.State.outTrans" name="outTrans" upper="*" type="hstmMM_p.Trans"
+ opposite="hstmMM_p.Trans.fromState"/>
+ <ownedAttribute xmi:id="hstmMM_p.State.inTrans" name="inTrans" upper="*" type="hstmMM_p.Trans"
+ opposite="hstmMM_p.Trans.toState"/>
+ <ownedAttribute xmi:id="hstmMM_p.State.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/mof/2.0/emof.xmi#String"/>
+ </ownedAttribute>
+ </ownedType>
+ <ownedType xmi:type="emof:Class" xmi:id="hstmMM_p.Trans" name="Trans">
+ <ownedAttribute xmi:id="hstmMM_p.Trans.fromState" name="fromState" lower="1" type="hstmMM_p.State"
+ opposite="hstmMM_p.State.outTrans"/>
+ <ownedAttribute xmi:id="hstmMM_p.Trans.toState" name="toState" lower="1" type="hstmMM_p.State"
+ opposite="hstmMM_p.State.inTrans"/>
+ <ownedAttribute xmi:id="hstmMM_p.Trans.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/mof/2.0/emof.xmi#String"/>
+ </ownedAttribute>
+ </ownedType>
+ <ownedType xmi:type="emof:Class" xmi:id="hstmMM_p.dummy" name="dummy">
+ <ownedAttribute xmi:id="hstmMM_p.dummy.contains_state" name="contains_state" upper="*"
+ type="hstmMM_p.State" isComposite="true"/>
+ <ownedAttribute xmi:id="hstmMM_p.dummy.conatains_trans" name="conatains_trans"
+ upper="*" type="hstmMM_p.Trans" isComposite="true"/>
+ <ownedAttribute xmi:id="hstmMM_p.dummy.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/mof/2.0/emof.xmi#String"/>
+ </ownedAttribute>
+ </ownedType>
+</emof:Package>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmUM.xml b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmUM.xml
new file mode 100644
index 000000000..afd765fe6
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmUM.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<null:dummy xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:null="hstmMM_p" xmi:id="_5qCwgELrEdu-SI8DyztHqw">
+ <contains_state xmi:id="_ax47IELsEdu-SI8DyztHqw" containsState="_bOzgoELsEdu-SI8DyztHqw _bZOn8ELsEdu-SI8DyztHqw" outTrans="_pI2ZoELsEdu-SI8DyztHqw" name="s1"/>
+ <contains_state xmi:id="_bDeaYELsEdu-SI8DyztHqw" containsState="_bx0uIELsEdu-SI8DyztHqw _b-VgIELsEdu-SI8DyztHqw" inTrans="_pI2ZoELsEdu-SI8DyztHqw" name="s2"/>
+ <contains_state xmi:id="_bOzgoELsEdu-SI8DyztHqw" containsState="_cHk7sELsEdu-SI8DyztHqw _cPoEcELsEdu-SI8DyztHqw" containedInState="_ax47IELsEdu-SI8DyztHqw" outTrans="_r_sD4ELsEdu-SI8DyztHqw" name="s3"/>
+ <contains_state xmi:id="_bZOn8ELsEdu-SI8DyztHqw" containsState="_cXXrMELsEdu-SI8DyztHqw _cerNEELsEdu-SI8DyztHqw" containedInState="_ax47IELsEdu-SI8DyztHqw" inTrans="_r_sD4ELsEdu-SI8DyztHqw" name="s4"/>
+ <contains_state xmi:id="_bx0uIELsEdu-SI8DyztHqw" containsState="_clhb8ELsEdu-SI8DyztHqw _c29xQELsEdu-SI8DyztHqw" containedInState="_bDeaYELsEdu-SI8DyztHqw" outTrans="_plw_IELsEdu-SI8DyztHqw" name="s5"/>
+ <contains_state xmi:id="_b-VgIELsEdu-SI8DyztHqw" containsState="_dbLRkELsEdu-SI8DyztHqw _dmyrsELsEdu-SI8DyztHqw" containedInState="_bDeaYELsEdu-SI8DyztHqw" inTrans="_plw_IELsEdu-SI8DyztHqw" name="s6"/>
+ <contains_state xmi:id="_cHk7sELsEdu-SI8DyztHqw" containedInState="_bOzgoELsEdu-SI8DyztHqw" outTrans="_p3yjQELsEdu-SI8DyztHqw" name="s7"/>
+ <contains_state xmi:id="_cPoEcELsEdu-SI8DyztHqw" containedInState="_bOzgoELsEdu-SI8DyztHqw" inTrans="_p3yjQELsEdu-SI8DyztHqw" name="s8"/>
+ <contains_state xmi:id="_cXXrMELsEdu-SI8DyztHqw" containedInState="_bZOn8ELsEdu-SI8DyztHqw" outTrans="_qKakUELsEdu-SI8DyztHqw" name="s9"/>
+ <contains_state xmi:id="_cerNEELsEdu-SI8DyztHqw" containedInState="_bZOn8ELsEdu-SI8DyztHqw" inTrans="_qKakUELsEdu-SI8DyztHqw" name="s10"/>
+ <contains_state xmi:id="_clhb8ELsEdu-SI8DyztHqw" containedInState="_bx0uIELsEdu-SI8DyztHqw" outTrans="_qf328ELsEdu-SI8DyztHqw" name="s11"/>
+ <contains_state xmi:id="_c29xQELsEdu-SI8DyztHqw" containedInState="_bx0uIELsEdu-SI8DyztHqw" inTrans="_qf328ELsEdu-SI8DyztHqw" name="s12"/>
+ <contains_state xmi:id="_dbLRkELsEdu-SI8DyztHqw" containedInState="_b-VgIELsEdu-SI8DyztHqw" outTrans="_q33gMELsEdu-SI8DyztHqw" name="s13"/>
+ <contains_state xmi:id="_dmyrsELsEdu-SI8DyztHqw" containedInState="_b-VgIELsEdu-SI8DyztHqw" inTrans="_q33gMELsEdu-SI8DyztHqw" name="s14"/>
+ <conatains_trans xmi:id="_pI2ZoELsEdu-SI8DyztHqw" fromState="_ax47IELsEdu-SI8DyztHqw" toState="_bDeaYELsEdu-SI8DyztHqw" name="t1_2"/>
+ <conatains_trans xmi:id="_r_sD4ELsEdu-SI8DyztHqw" fromState="_bOzgoELsEdu-SI8DyztHqw" toState="_bZOn8ELsEdu-SI8DyztHqw" name="t3_4"/>
+ <conatains_trans xmi:id="_plw_IELsEdu-SI8DyztHqw" fromState="_bx0uIELsEdu-SI8DyztHqw" toState="_b-VgIELsEdu-SI8DyztHqw" name="t5_6"/>
+ <conatains_trans xmi:id="_p3yjQELsEdu-SI8DyztHqw" fromState="_cHk7sELsEdu-SI8DyztHqw" toState="_cPoEcELsEdu-SI8DyztHqw" name="t7_8"/>
+ <conatains_trans xmi:id="_qKakUELsEdu-SI8DyztHqw" fromState="_cXXrMELsEdu-SI8DyztHqw" toState="_cerNEELsEdu-SI8DyztHqw" name="t9_10"/>
+ <conatains_trans xmi:id="_qf328ELsEdu-SI8DyztHqw" fromState="_clhb8ELsEdu-SI8DyztHqw" toState="_c29xQELsEdu-SI8DyztHqw" name="t11_12"/>
+ <conatains_trans xmi:id="_q33gMELsEdu-SI8DyztHqw" fromState="_dbLRkELsEdu-SI8DyztHqw" toState="_dmyrsELsEdu-SI8DyztHqw" name="t13_14"/>
+</null:dummy>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmtostm.qvt b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmtostm.qvt
new file mode 100644
index 000000000..800509f8d
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmtostm.qvt
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2007,2008 Tata Consultancy Services and others.
+ * 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:
+ * TCS - initial implementation for ModelMorf
+ * E.D.Willink - alignment with evolved specification
+ *******************************************************************************/
+transformation HstmToStm(hstm:hstmMM_p; stm:stmMM_p)
+{
+ key hstmMM_p::State {name};
+ key hstmMM_p::Trans {name, fromState, toState};
+ key stmMM_p::State {name};
+ key stmMM_p::Trans {name, fromState, toState};
+
+ query StateContainsState(cState:hstmMM_p::State, mState:hstmMM_p::State):Boolean
+ {
+ if (mState.containedInState->isEmpty())
+ then
+ false
+ else if (mState.containedInState = cState)
+ then
+ true
+ else
+ StateContainsState(cState, mState.containedInState)
+ endif
+ endif
+ }
+
+ top relation LStateToState -- Leaf States
+ {
+ n : String;
+
+ domain hstm s1:State
+ {
+ name = n
+ } {s1.containsState->isEmpty()};
+
+ enforce domain stm s2:State
+ {
+ name = n
+ };
+ }
+
+ top relation CStateToState -- Branch States
+ {
+ tn : String;
+ ms1: hstmMM_p::State;
+ ms2: hstmMM_p::State;
+ ts1: hstmMM_p::State;
+ ts2: stmMM_p::State;
+
+ domain hstm fs1:State
+ {
+ outTrans = t1:Trans {name = tn, toState = ts1}
+ };
+
+ enforce domain stm fs2:State
+ {
+ outTrans = t2:Trans {name = tn, toState = ts2}
+ };
+
+ when
+ {
+ LStateToState(ms1, fs2);
+ (
+ ms1 = fs1
+ or
+ StateContainsState(fs1, ms1)
+ );
+ LStateToState(ms2, ts2);
+ (
+ ms2 = ts1
+ or
+ StateContainsState(ts1, ms2)
+ );
+ }
+ }
+}
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmtostm.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmtostm.qvtr
new file mode 100644
index 000000000..c90f62fea
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/hstmtostm.qvtr
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2007,2008 Tata Consultancy Services and others.
+ * 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:
+ * TCS - initial implementation for ModelMorf
+ * E.D.Willink - alignment with evolved specification
+ *******************************************************************************/
+import hstmMM_p : 'hstmMM.emof'::hstmMM_p;
+import stmMM_p : 'stmMM.emof'::stmMM_p;
+
+transformation HstmToStm(hstm:hstmMM_p, stm:stmMM_p)
+{
+ key hstmMM_p::State {name};
+ key hstmMM_p::Trans {name, fromState, toState};
+ key stmMM_p::State {name};
+ key stmMM_p::Trans {name, fromState, toState};
+
+ query StateContainsState(cState:hstmMM_p::State, mState:hstmMM_p::State):Boolean
+ {
+ if (mState.containedInState->isEmpty())
+ then
+ false
+ else if (mState.containedInState = cState)
+ then
+ true
+ else
+ StateContainsState(cState, mState.containedInState)
+ endif
+ endif
+ }
+
+ top relation LStateToState -- Leaf States
+ {
+ n : String;
+
+ domain hstm s1:State
+ {
+ name = n
+ } {s1.containsState->isEmpty()};
+
+ enforce domain stm s2:State
+ {
+ name = n
+ };
+ }
+
+ top relation CStateToState -- Branch States
+ {
+ tn : String;
+ ms1: hstmMM_p::State;
+ ms2: hstmMM_p::State;
+ ts1: hstmMM_p::State;
+ ts2: stmMM_p::State;
+
+ domain hstm fs1:State
+ {
+ outTrans = t1:Trans {name = tn, toState = ts1}
+ };
+
+ enforce domain stm fs2:State
+ {
+ outTrans = t2:Trans {name = tn, toState = ts2}
+ };
+
+ when
+ {
+ LStateToState(ms1, fs2);
+ (
+ ms1 = fs1
+ or
+ StateContainsState(fs1, ms1)
+ );
+ LStateToState(ms2, ts2);
+ (
+ ms2 = ts1
+ or
+ StateContainsState(ts1, ms2)
+ );
+ }
+ }
+}
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmMM.emof b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmMM.emof
new file mode 100644
index 000000000..b6652c735
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmMM.emof
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2007,2008 Tata Consultancy Services and others.
+ * 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:
+ * TCS - initial implementation for ModelMorf
+ * E.D.Willink - alignment with evolved specification
+-->
+<emof:Package xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:emof="http://schema.omg.org/spec/MOF/2.0/emof.xml" xmi:id="stmMM_p"
+ name="stmMM_p" uri="stmMM_p">
+ <ownedType xmi:type="emof:Class" xmi:id="stmMM_p.State" name="State">
+ <ownedAttribute xmi:id="stmMM_p.State.outTrans" name="outTrans" upper="*" type="stmMM_p.Trans"
+ opposite="stmMM_p.Trans.fromState"/>
+ <ownedAttribute xmi:id="stmMM_p.State.inTrans" name="inTrans" upper="*" type="stmMM_p.Trans"
+ opposite="stmMM_p.Trans.toState"/>
+ <ownedAttribute xmi:id="stmMM_p.State.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/MOF/2.0/emof.xml#String"/>
+ </ownedAttribute>
+ </ownedType>
+ <ownedType xmi:type="emof:Class" xmi:id="stmMM_p.Trans" name="Trans">
+ <ownedAttribute xmi:id="stmMM_p.Trans.fromState" name="fromState" lower="1" type="stmMM_p.State"
+ opposite="stmMM_p.State.outTrans"/>
+ <ownedAttribute xmi:id="stmMM_p.Trans.toState" name="toState" lower="1" type="stmMM_p.State"
+ opposite="stmMM_p.State.inTrans"/>
+ <ownedAttribute xmi:id="stmMM_p.Trans.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/MOF/2.0/emof.xml#String"/>
+ </ownedAttribute>
+ </ownedType>
+ <ownedType xmi:type="emof:Class" xmi:id="stmMM_p.dummy" name="dummy">
+ <ownedAttribute xmi:id="stmMM_p.dummy.container_state" name="container_state"
+ upper="*" type="stmMM_p.State" isComposite="true"/>
+ <ownedAttribute xmi:id="stmMM_p.dummy.container_trans" name="container_trans"
+ upper="*" type="stmMM_p.Trans" isComposite="true"/>
+ <ownedAttribute xmi:id="stmMM_p.dummy.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/MOF/2.0/emof.xml#String"/>
+ </ownedAttribute>
+ </ownedType>
+</emof:Package>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmMM.xml b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmMM.xml
new file mode 100644
index 000000000..6e908e7fb
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmMM.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<emof:Package xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:emof="http://schema.omg.org/spec/mof/2.0/emof.xmi" xmi:id="stmMM_p"
+ name="stmMM_p" uri="stmMM_p">
+ <ownedType xmi:type="emof:Class" xmi:id="stmMM_p.State" name="State">
+ <ownedAttribute xmi:id="stmMM_p.State.outTrans" name="outTrans" upper="*" type="stmMM_p.Trans"
+ opposite="stmMM_p.Trans.fromState"/>
+ <ownedAttribute xmi:id="stmMM_p.State.inTrans" name="inTrans" upper="*" type="stmMM_p.Trans"
+ opposite="stmMM_p.Trans.toState"/>
+ <ownedAttribute xmi:id="stmMM_p.State.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/mof/2.0/emof.xmi#String"/>
+ </ownedAttribute>
+ </ownedType>
+ <ownedType xmi:type="emof:Class" xmi:id="stmMM_p.Trans" name="Trans">
+ <ownedAttribute xmi:id="stmMM_p.Trans.fromState" name="fromState" lower="1" type="stmMM_p.State"
+ opposite="stmMM_p.State.outTrans"/>
+ <ownedAttribute xmi:id="stmMM_p.Trans.toState" name="toState" lower="1" type="stmMM_p.State"
+ opposite="stmMM_p.State.inTrans"/>
+ <ownedAttribute xmi:id="stmMM_p.Trans.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/mof/2.0/emof.xmi#String"/>
+ </ownedAttribute>
+ </ownedType>
+ <ownedType xmi:type="emof:Class" xmi:id="stmMM_p.dummy" name="dummy">
+ <ownedAttribute xmi:id="stmMM_p.dummy.container_state" name="container_state"
+ upper="*" type="stmMM_p.State" isComposite="true"/>
+ <ownedAttribute xmi:id="stmMM_p.dummy.container_trans" name="container_trans"
+ upper="*" type="stmMM_p.Trans" isComposite="true"/>
+ <ownedAttribute xmi:id="stmMM_p.dummy.name" name="name">
+ <type xmi:type="emof:PrimitiveType" href="http://schema.omg.org/spec/mof/2.0/emof.xmi#String"/>
+ </ownedAttribute>
+ </ownedType>
+</emof:Package>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmUM.xml b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmUM.xml
new file mode 100644
index 000000000..2b34c0116
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm/stmUM.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:stmMM_p="stmMM_p">
+ <stmMM_p:State xmi:id="c597ec6833546657-212edce7232a5161" name="s7" outTrans="df30581b960321ef-b976f4aeaaf4c004 925e374ba158c409-8c670e08b79f8cc5 8b5e2d58f1dbb0c2-aa85cc6e8540777d e035efbe553692f8-4124f6d3d2b07e88 630accd75fe84243-24fbd35a58e92d65 ac30f85e88688b9-630dafa7fef4a1b7 1e1e19305e4bfce9-38728937feea8895"/>
+ <stmMM_p:State xmi:id="a2d16df43a7f0624-3e6c6fc9774cdafb" name="s8" outTrans="69debe406ade59cb-ba069e49cf99195 786de056101c0456-9def8e91ba8f3ce7 98b235baa1f26bdb-cbc879c82198c50 18f63cd03e0ffdf2-ad594ee5dfc60310 9d5ea5a95630ddba-e11a4215c7d9cf28 8ae4d2cf1a1fb5d6-da441af4c9cb51dc" inTrans="1e1e19305e4bfce9-38728937feea8895"/>
+ <stmMM_p:State xmi:id="7d1d9b2cd9b0d32a-c487a386dbaac4ed" name="s9" outTrans="82b095bdf9e5c777-b8f9dc8c04c7edfd b444e76d52145246-aa81551d5d2b9799 2dafb3cf4027fb10-4cc3f164c8db9202 7c472b176d7e59c7-b6c929a31e6b70e8 ccd0ef084f8df07f-ec927b8fb1a863a1" inTrans="630accd75fe84243-24fbd35a58e92d65 9d5ea5a95630ddba-e11a4215c7d9cf28"/>
+ <stmMM_p:State xmi:id="fc4d4d81a70f08ba-6cef3292ba7e516c" name="s10" outTrans="466df9c8559e6e77-32ab772b5a9d7ddf ab273c8c42f4d7e-93db0ab7b1c13bd4 4661eeda84cb518f-2265f3065575826c 2ffda92c8b5f36d8-d6bdae642c93a88c" inTrans="ac30f85e88688b9-630dafa7fef4a1b7 8ae4d2cf1a1fb5d6-da441af4c9cb51dc ccd0ef084f8df07f-ec927b8fb1a863a1"/>
+ <stmMM_p:State xmi:id="9b76fae2368c51d2-5d15c2f9bd00b7a7" name="s11" outTrans="76b6dd246aa8b0c9-3bff4848997698bc 5ccca023e5bb5843-3d74cde098ce9b04 5717723e0977b7a5-3e30336eab10e5d6" inTrans="df30581b960321ef-b976f4aeaaf4c004 69debe406ade59cb-ba069e49cf99195 82b095bdf9e5c777-b8f9dc8c04c7edfd 466df9c8559e6e77-32ab772b5a9d7ddf"/>
+ <stmMM_p:State xmi:id="b3ccbf7c0b0e664d-31fd1f289118d0dd" name="s12" outTrans="bf63fb040b6b3ba9-93cc16fa17241615 fbc0f160fb76be4b-6f669e187abce49e" inTrans="925e374ba158c409-8c670e08b79f8cc5 786de056101c0456-9def8e91ba8f3ce7 b444e76d52145246-aa81551d5d2b9799 ab273c8c42f4d7e-93db0ab7b1c13bd4 5717723e0977b7a5-3e30336eab10e5d6"/>
+ <stmMM_p:State xmi:id="17e3ee6973eb6f49-c5543c6f279f2cf6" name="s13" outTrans="40820c6794bf8511-bdb6020058fd40f7" inTrans="8b5e2d58f1dbb0c2-aa85cc6e8540777d 98b235baa1f26bdb-cbc879c82198c50 2dafb3cf4027fb10-4cc3f164c8db9202 4661eeda84cb518f-2265f3065575826c 76b6dd246aa8b0c9-3bff4848997698bc bf63fb040b6b3ba9-93cc16fa17241615"/>
+ <stmMM_p:State xmi:id="c83211e9c010324d-d6b506081f5451b8" name="s14" inTrans="e035efbe553692f8-4124f6d3d2b07e88 18f63cd03e0ffdf2-ad594ee5dfc60310 7c472b176d7e59c7-b6c929a31e6b70e8 2ffda92c8b5f36d8-d6bdae642c93a88c 5ccca023e5bb5843-3d74cde098ce9b04 fbc0f160fb76be4b-6f669e187abce49e 40820c6794bf8511-bdb6020058fd40f7"/>
+ <stmMM_p:Trans xmi:id="df30581b960321ef-b976f4aeaaf4c004" name="t1_2" fromState="c597ec6833546657-212edce7232a5161" toState="9b76fae2368c51d2-5d15c2f9bd00b7a7"/>
+ <stmMM_p:Trans xmi:id="925e374ba158c409-8c670e08b79f8cc5" name="t1_2" fromState="c597ec6833546657-212edce7232a5161" toState="b3ccbf7c0b0e664d-31fd1f289118d0dd"/>
+ <stmMM_p:Trans xmi:id="8b5e2d58f1dbb0c2-aa85cc6e8540777d" name="t1_2" fromState="c597ec6833546657-212edce7232a5161" toState="17e3ee6973eb6f49-c5543c6f279f2cf6"/>
+ <stmMM_p:Trans xmi:id="e035efbe553692f8-4124f6d3d2b07e88" name="t1_2" fromState="c597ec6833546657-212edce7232a5161" toState="c83211e9c010324d-d6b506081f5451b8"/>
+ <stmMM_p:Trans xmi:id="69debe406ade59cb-ba069e49cf99195" name="t1_2" fromState="a2d16df43a7f0624-3e6c6fc9774cdafb" toState="9b76fae2368c51d2-5d15c2f9bd00b7a7"/>
+ <stmMM_p:Trans xmi:id="786de056101c0456-9def8e91ba8f3ce7" name="t1_2" fromState="a2d16df43a7f0624-3e6c6fc9774cdafb" toState="b3ccbf7c0b0e664d-31fd1f289118d0dd"/>
+ <stmMM_p:Trans xmi:id="98b235baa1f26bdb-cbc879c82198c50" name="t1_2" fromState="a2d16df43a7f0624-3e6c6fc9774cdafb" toState="17e3ee6973eb6f49-c5543c6f279f2cf6"/>
+ <stmMM_p:Trans xmi:id="18f63cd03e0ffdf2-ad594ee5dfc60310" name="t1_2" fromState="a2d16df43a7f0624-3e6c6fc9774cdafb" toState="c83211e9c010324d-d6b506081f5451b8"/>
+ <stmMM_p:Trans xmi:id="82b095bdf9e5c777-b8f9dc8c04c7edfd" name="t1_2" fromState="7d1d9b2cd9b0d32a-c487a386dbaac4ed" toState="9b76fae2368c51d2-5d15c2f9bd00b7a7"/>
+ <stmMM_p:Trans xmi:id="b444e76d52145246-aa81551d5d2b9799" name="t1_2" fromState="7d1d9b2cd9b0d32a-c487a386dbaac4ed" toState="b3ccbf7c0b0e664d-31fd1f289118d0dd"/>
+ <stmMM_p:Trans xmi:id="2dafb3cf4027fb10-4cc3f164c8db9202" name="t1_2" fromState="7d1d9b2cd9b0d32a-c487a386dbaac4ed" toState="17e3ee6973eb6f49-c5543c6f279f2cf6"/>
+ <stmMM_p:Trans xmi:id="7c472b176d7e59c7-b6c929a31e6b70e8" name="t1_2" fromState="7d1d9b2cd9b0d32a-c487a386dbaac4ed" toState="c83211e9c010324d-d6b506081f5451b8"/>
+ <stmMM_p:Trans xmi:id="466df9c8559e6e77-32ab772b5a9d7ddf" name="t1_2" fromState="fc4d4d81a70f08ba-6cef3292ba7e516c" toState="9b76fae2368c51d2-5d15c2f9bd00b7a7"/>
+ <stmMM_p:Trans xmi:id="ab273c8c42f4d7e-93db0ab7b1c13bd4" name="t1_2" fromState="fc4d4d81a70f08ba-6cef3292ba7e516c" toState="b3ccbf7c0b0e664d-31fd1f289118d0dd"/>
+ <stmMM_p:Trans xmi:id="4661eeda84cb518f-2265f3065575826c" name="t1_2" fromState="fc4d4d81a70f08ba-6cef3292ba7e516c" toState="17e3ee6973eb6f49-c5543c6f279f2cf6"/>
+ <stmMM_p:Trans xmi:id="2ffda92c8b5f36d8-d6bdae642c93a88c" name="t1_2" fromState="fc4d4d81a70f08ba-6cef3292ba7e516c" toState="c83211e9c010324d-d6b506081f5451b8"/>
+ <stmMM_p:Trans xmi:id="630accd75fe84243-24fbd35a58e92d65" name="t3_4" fromState="c597ec6833546657-212edce7232a5161" toState="7d1d9b2cd9b0d32a-c487a386dbaac4ed"/>
+ <stmMM_p:Trans xmi:id="ac30f85e88688b9-630dafa7fef4a1b7" name="t3_4" fromState="c597ec6833546657-212edce7232a5161" toState="fc4d4d81a70f08ba-6cef3292ba7e516c"/>
+ <stmMM_p:Trans xmi:id="9d5ea5a95630ddba-e11a4215c7d9cf28" name="t3_4" fromState="a2d16df43a7f0624-3e6c6fc9774cdafb" toState="7d1d9b2cd9b0d32a-c487a386dbaac4ed"/>
+ <stmMM_p:Trans xmi:id="8ae4d2cf1a1fb5d6-da441af4c9cb51dc" name="t3_4" fromState="a2d16df43a7f0624-3e6c6fc9774cdafb" toState="fc4d4d81a70f08ba-6cef3292ba7e516c"/>
+ <stmMM_p:Trans xmi:id="76b6dd246aa8b0c9-3bff4848997698bc" name="t5_6" fromState="9b76fae2368c51d2-5d15c2f9bd00b7a7" toState="17e3ee6973eb6f49-c5543c6f279f2cf6"/>
+ <stmMM_p:Trans xmi:id="5ccca023e5bb5843-3d74cde098ce9b04" name="t5_6" fromState="9b76fae2368c51d2-5d15c2f9bd00b7a7" toState="c83211e9c010324d-d6b506081f5451b8"/>
+ <stmMM_p:Trans xmi:id="bf63fb040b6b3ba9-93cc16fa17241615" name="t5_6" fromState="b3ccbf7c0b0e664d-31fd1f289118d0dd" toState="17e3ee6973eb6f49-c5543c6f279f2cf6"/>
+ <stmMM_p:Trans xmi:id="fbc0f160fb76be4b-6f669e187abce49e" name="t5_6" fromState="b3ccbf7c0b0e664d-31fd1f289118d0dd" toState="c83211e9c010324d-d6b506081f5451b8"/>
+ <stmMM_p:Trans xmi:id="1e1e19305e4bfce9-38728937feea8895" name="t7_8" fromState="c597ec6833546657-212edce7232a5161" toState="a2d16df43a7f0624-3e6c6fc9774cdafb"/>
+ <stmMM_p:Trans xmi:id="ccd0ef084f8df07f-ec927b8fb1a863a1" name="t9_10" fromState="7d1d9b2cd9b0d32a-c487a386dbaac4ed" toState="fc4d4d81a70f08ba-6cef3292ba7e516c"/>
+ <stmMM_p:Trans xmi:id="5717723e0977b7a5-3e30336eab10e5d6" name="t11_12" fromState="9b76fae2368c51d2-5d15c2f9bd00b7a7" toState="b3ccbf7c0b0e664d-31fd1f289118d0dd"/>
+ <stmMM_p:Trans xmi:id="40820c6794bf8511-bdb6020058fd40f7" name="t13_14" fromState="17e3ee6973eb6f49-c5543c6f279f2cf6" toState="c83211e9c010324d-d6b506081f5451b8"/>
+</xmi:XMI>
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/MetamodelEntry.java b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/MetamodelEntry.java
new file mode 100644
index 000000000..a3fe7afc4
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/MetamodelEntry.java
@@ -0,0 +1,43 @@
+package org.eclipse.qvtd.examples.qvtrelation.modelmorf;
+
+public class MetamodelEntry {
+
+ private String alias;
+ private String file;
+ private String reference;
+ private boolean relative = false;
+
+
+ public MetamodelEntry() {
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+ public String getFile() {
+ return file;
+ }
+ public void setFile(String file) {
+ this.file = file;
+ setRelative(false);
+ }
+ public String getReference() {
+ return reference;
+ }
+ public void setReference(String reference) {
+ this.reference = reference;
+ setRelative(true);
+ }
+
+ public boolean isRelative() {
+ return relative;
+ }
+
+ public void setRelative(boolean relative) {
+ this.relative = relative;
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/ModelEntry.java b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/ModelEntry.java
new file mode 100644
index 000000000..dbdf2ce67
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/ModelEntry.java
@@ -0,0 +1,52 @@
+package org.eclipse.qvtd.examples.qvtrelation.modelmorf;
+
+public class ModelEntry {
+ private String variable;
+ private String file;
+ private String variableRef;
+ private String deltaFile;
+ private boolean bound = false;
+ private boolean delta = false;
+ public String getVariable() {
+ return variable;
+ }
+ public void setVariable(String variable) {
+ this.variable = variable;
+ }
+ public String getFile() {
+ return file;
+ }
+ public void setFile(String file) {
+ this.file = file;
+ setBound(false);
+ }
+ public String getVariableRef() {
+ return variableRef;
+ }
+ public void setVariableRef(String variableRef) {
+ this.variableRef = variableRef;
+ setBound(true);
+ }
+ public String getDeltaFile() {
+ return deltaFile;
+ }
+ public void setDeltaFile(String deltaFile) {
+ this.deltaFile = deltaFile;
+ setDelta(true);
+ }
+ public boolean isBound() {
+ return bound;
+ }
+ public void setBound(boolean bound) {
+ this.bound = bound;
+ }
+ public boolean hasDelta() {
+ return delta;
+ }
+ public void setDelta(boolean delta) {
+ this.delta = delta;
+ }
+
+
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/ModelMorfComponent.java b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/ModelMorfComponent.java
new file mode 100644
index 000000000..13c8c2bce
--- /dev/null
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/src/org/eclipse/qvtd/examples/qvtrelation/modelmorf/ModelMorfComponent.java
@@ -0,0 +1,298 @@
+/*******************************************************************************
+ * Copyright (c) 2014 The University of York, Willink Transformations and others.
+ * 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:
+ * Horacio Hoyos - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.qvtd.examples.qvtrelation.modelmorf;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent;
+import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext;
+
+public class ModelMorfComponent implements IWorkflowComponent {
+
+ private static final String METAMODEL_ALIAS = "-m";
+ private static final String METAMODEL_FILE = "-mf";
+ private static final String METAMODEL_REFERENCE = "-mi";
+ private static final String QVT_SPECIFICATION_FILE = "-c";
+ private static final String IMPORTED_QVT_FILE_DIR = "-qp";
+ private static final String MODEL_VARIABLE = "-u";
+ private static final String MODEL_FILE = "-f";
+ private static final String MODEL_REFERENCE = "-ui";
+ private static final String MODEL_DELTA = "-df";
+ private static final String TRANSFORMATION_NAME = "-t";
+ private static final String TOP_RELATION_NAME = "-r";
+ private static final String DIRECTION_DOMAIN = "-d";
+ private static final String DOMAIN_QUALIFIER = "-q";
+ private static final String TRACE_OUTPUT_FILE = "-tox";
+ private static final String TRACE_INPUT_FILE = "-tix";
+ private static final String INCREMENTAL = "-it";
+
+ private String java15Path; // Path to Java 1.5 bin folder
+ private String modelMorfPath; // Path to ModelMorf Installation
+ private String javaCommand = "java"; // Java command
+
+ private List<MetamodelEntry> metamodels;
+ private List<String> importedQvtFileDir;
+ private List<ModelEntry> models;
+
+ private String qvtSpecificationFile;
+ private String transformationName;
+ private String topRelationName;
+ private String directionDomain;
+ private String domainQualifier;
+ private String traceOutputFile;
+ private String traceInputFile;
+ private boolean incremental;
+
+
+
+ public ModelMorfComponent() {
+ metamodels = new ArrayList<MetamodelEntry>();
+ models = new ArrayList<ModelEntry>();
+ importedQvtFileDir = new ArrayList<String>();
+ }
+
+ public void preInvoke() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void invoke(IWorkflowContext ctx) {
+ // TODO test all parameters are correct and required values set
+
+ List<String> arguments = new ArrayList<String>();
+ StringBuilder argBuilder = new StringBuilder();
+ // Create the java arguments
+ argBuilder.append(java15Path);
+ if (!java15Path.endsWith("\\")) {
+ argBuilder.append("\\");
+ }
+ argBuilder.append(javaCommand);
+ arguments.add(argBuilder.toString());
+ argBuilder.setLength(0);
+ arguments.add("-jar");
+ argBuilder.append(modelMorfPath);
+ if (!modelMorfPath.endsWith("\\")) {
+ argBuilder.append("\\");
+ }
+ argBuilder.append("qvt.jar");
+ arguments.add(argBuilder.toString());
+ argBuilder.setLength(0);
+ arguments.add("-p");
+ arguments.add(modelMorfPath);
+ // ( -m meta_model_alias ( -mf meta_model_file | -mi meta_model_ref ) )+
+ Iterator<MetamodelEntry> mmit = metamodels.iterator();
+ while (mmit.hasNext()) {
+ MetamodelEntry entry = mmit.next();
+ arguments.add(METAMODEL_ALIAS);
+ arguments.add(entry.getAlias());
+ if (entry.isRelative()) {
+ arguments.add(METAMODEL_REFERENCE);
+ arguments.add(entry.getReference());
+ } else {
+ arguments.add(METAMODEL_FILE);
+ arguments.add(entry.getFile());
+ }
+ }
+ // -c qvt_specification_file
+ arguments.add(QVT_SPECIFICATION_FILE);
+ arguments.add(getQvtSpecificationFile());
+ // [ -qp imported_qvt_file_dir ( ';' imported_qvt_file_dir )* ]
+ if (!importedQvtFileDir.isEmpty()) {
+ arguments.add(IMPORTED_QVT_FILE_DIR);
+ Iterator<String> lIt = importedQvtFileDir.iterator();
+ while(lIt.hasNext()) {
+ argBuilder.append(lIt.next());
+ if (lIt.hasNext()) {
+ argBuilder.append(";");
+ }
+ }
+ arguments.add(argBuilder.toString());
+ argBuilder.setLength(0);
+ }
+ // ( -u model_variable ( -f instance_model_file | -ui model_variable_ref ) [ -df model_delta_file ] )+
+ Iterator<ModelEntry> mit = models.iterator();
+ while (mit.hasNext()) {
+ ModelEntry entry = mit.next();
+ arguments.add(MODEL_VARIABLE);
+ arguments.add(entry.getVariable());
+ if (entry.isBound()) {
+ arguments.add(MODEL_REFERENCE);
+ arguments.add(entry.getVariableRef());
+ } else {
+ arguments.add(MODEL_FILE);
+ arguments.add(entry.getFile());
+ }
+ if (entry.hasDelta()) {
+ arguments.add(MODEL_DELTA);
+ arguments.add(entry.getDeltaFile());
+ }
+ }
+ // -t transformation_name [-r top_relation_name ]
+ arguments.add(TRANSFORMATION_NAME);
+ arguments.add(getTransformationName());
+ if (getTopRelationName() != null) {
+ arguments.add(TOP_RELATION_NAME);
+ arguments.add(getTransformationName());
+ }
+ // -d direction_domain -q domain_qualifier
+ arguments.add(DIRECTION_DOMAIN);
+ arguments.add(getDirectionDomain());
+ arguments.add(DOMAIN_QUALIFIER);
+ arguments.add(getDomainQualifier());
+ //[ -tox trace_output_file ] [ -tix trace_input_file ] [ -it ]
+ if (getTraceOutputFile() != null) {
+ arguments.add(TRACE_OUTPUT_FILE);
+ arguments.add(getTraceOutputFile());
+ }
+ if (getTraceInputFile() != null) {
+ arguments.add(TRACE_INPUT_FILE);
+ arguments.add(getTraceOutputFile());
+ }
+ if (isIncremental()) {
+ arguments.add(INCREMENTAL);
+ }
+
+ ProcessBuilder probuilder = new ProcessBuilder(arguments);
+ //process.redirectErrorStream(true);
+ File dir = new File("C:/git/org.eclipse.qvtd/examples/org.eclipse.qvtd.examples.qvtrelation.modelmorf/qvtrsrc/org/eclipse/qvtd/examples/qvtrelation/modelmorf/hstmtostm");
+ probuilder .directory(dir);
+ System.out.println(probuilder .directory());
+ probuilder.redirectErrorStream(true);
+ try {
+ Process process = probuilder .start();
+ //Read out dir output
+ InputStream is = process.getInputStream();
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+ String line;
+ System.out.printf("Running ModelMorf with the given parameters.");
+ while ((line = br.readLine()) != null) {
+ System.out.println(line);
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public void postInvoke() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public String getJava15Path() {
+ return java15Path;
+ }
+
+ public void setJava15Path(String java15Path) {
+ this.java15Path = java15Path;
+ }
+
+ public String getModelMorfPath() {
+ return modelMorfPath;
+ }
+
+ public void setModelMorfPath(String modelMorfPath) {
+ this.modelMorfPath = modelMorfPath;
+ }
+
+ public String getJavaCommand() {
+ return javaCommand;
+ }
+
+ public void setJavaCommand(String javaCommand) {
+ this.javaCommand = javaCommand;
+ }
+
+ public String getQvtSpecificationFile() {
+ return qvtSpecificationFile;
+ }
+
+ public void setQvtSpecificationFile(String qvtSpecificationFile) {
+ this.qvtSpecificationFile = qvtSpecificationFile;
+ }
+
+ public String getTransformationName() {
+ return transformationName;
+ }
+
+ public void setTransformationName(String transformationName) {
+ this.transformationName = transformationName;
+ }
+
+ public String getTopRelationName() {
+ return topRelationName;
+ }
+
+ public void setTopRelationName(String topRelationName) {
+ this.topRelationName = topRelationName;
+ }
+
+ public String getDirectionDomain() {
+ return directionDomain;
+ }
+
+ public void setDirectionDomain(String directionDomain) {
+ this.directionDomain = directionDomain;
+ }
+
+ public String getDomainQualifier() {
+ return domainQualifier;
+ }
+
+ public void setDomainQualifier(String domainQualifier) {
+ this.domainQualifier = domainQualifier;
+ }
+
+ public String getTraceOutputFile() {
+ return traceOutputFile;
+ }
+
+ public void setTraceOutputFile(String traceOutputFile) {
+ this.traceOutputFile = traceOutputFile;
+ }
+
+ public String getTraceInputFile() {
+ return traceInputFile;
+ }
+
+ public void setTraceInputFile(String traceInputFile) {
+ this.traceInputFile = traceInputFile;
+ }
+
+ public boolean isIncremental() {
+ return incremental;
+ }
+
+ public void setIncremental(boolean incremental) {
+ this.incremental = incremental;
+ }
+
+ public void addMetamodel(MetamodelEntry metamodel){
+ metamodels.add(metamodel);
+ }
+
+ public void addImportedQvtFileDir(String fileDir){
+ importedQvtFileDir.add(fileDir);
+ }
+
+ public void addModel(ModelEntry model) {
+ models.add(model);
+ }
+
+}

Back to the top