[517072] Adjust QVTc/QVTr examples to pass
diff --git a/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML.ecore b/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML.ecore
index 233831f..7ea66e8 100644
--- a/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML.ecore
+++ b/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML.ecore
@@ -30,13 +30,13 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="typeOpposite" upperBound="-1"
eType="#//Attribute" eOpposite="#//Attribute/type"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Package" eSuperTypes="#//UMLModelElement">
+ <eClassifiers xsi:type="ecore:EClass" name="Package" eSuperTypes="#//PackageElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="elements" upperBound="-1"
eType="#//PackageElement" containment="true" eOpposite="#//PackageElement/namespace"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PackageElement" abstract="true" eSuperTypes="#//UMLModelElement">
- <eStructuralFeatures xsi:type="ecore:EReference" name="namespace" lowerBound="1"
- eType="#//Package" eOpposite="#//Package/elements"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="namespace" eType="#//Package"
+ eOpposite="#//Package/elements"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PrimitiveDataType" eSuperTypes="#//Classifier"/>
<eClassifiers xsi:type="ecore:EClass" name="UMLModelElement" abstract="true">
diff --git a/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML2RDBMS.ecore b/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML2RDBMS.ecore
index 2caf1dd..d11d7fe 100644
--- a/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML2RDBMS.ecore
+++ b/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML2RDBMS.ecore
@@ -7,19 +7,15 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AssociationToForeignKey" eSuperTypes="#//ToColumn #//UmlToRdbmsModelElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="association" eType="ecore:EClass SimpleUML.ecore#//Association">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
+ <details key="upper" value="1"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="foreignKey" eType="ecore:EClass SimpleRDBMS.ecore#//ForeignKey">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
+ <details key="upper" value="1"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="owner" lowerBound="1" eType="#//ClassToTable"
@@ -33,38 +29,29 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="owner" lowerBound="1" eType="#//PackageToSchema"
eOpposite="#//PackageToSchema/classesToTables"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="primaryKey" eType="ecore:EClass SimpleRDBMS.ecore#//Key">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
+ <details key="upper" value="1"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="table" eType="ecore:EClass SimpleRDBMS.ecore#//Table">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="umlClass" eType="ecore:EClass SimpleUML.ecore#//Class">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
+ <details key="upper" value="1"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="FromAttribute" abstract="true" eSuperTypes="#//UmlToRdbmsModelElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="attribute" eType="ecore:EClass SimpleUML.ecore#//Attribute">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
+ <details key="upper" value="1"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="leafs" ordered="false"
@@ -86,20 +73,16 @@
upperBound="-1" eType="#//PrimitiveToName" containment="true" eOpposite="#//PrimitiveToName/owner"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="schema" lowerBound="1"
eType="ecore:EClass SimpleRDBMS.ecore#//Schema">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
+ <details key="upper" value="1"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="umlPackage" lowerBound="1"
eType="ecore:EClass SimpleUML.ecore#//Package">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
+ <details key="upper" value="1"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
@@ -110,11 +93,9 @@
eOpposite="#//PackageToSchema/primitivesToNames"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="primitive" lowerBound="1"
eType="ecore:EClass SimpleUML.ecore#//PrimitiveDataType">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
+ <details key="upper" value="1"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
@@ -122,11 +103,9 @@
<eClassifiers xsi:type="ecore:EClass" name="ToColumn" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="column" lowerBound="1"
eType="ecore:EClass SimpleRDBMS.ecore#//Column">
- <eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeUpper">
- <details key="body" value="1"/>
- </eAnnotations>
<eAnnotations source="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName">
<details key="body" value="middle"/>
+ <details key="upper" value="1"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
diff --git a/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML2RDBMS.qvtc b/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML2RDBMS.qvtc
index 3e89a45..b6c8495 100644
--- a/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML2RDBMS.qvtc
+++ b/examples/org.eclipse.qvtd.examples.qvtcore.uml2rdbms/src/org/eclipse/qvtd/examples/qvtcore/uml2rdbms/SimpleUML2RDBMS.qvtc
@@ -4,9 +4,9 @@
transformation org::eclipse::qvtd::examples::qvtcore::uml2rdbms::umlRdbms
{
- uml imports simpleuml;
- rdbms imports simplerdbms;
- imports simpleuml2rdbms;
+ uml imports SimpleUML;
+ rdbms imports SimpleRDBMS;
+ imports SimpleUML2RDBMS;
}
/*
* -- Package and Schema mapping
@@ -24,15 +24,15 @@
map packageToSchema in umlRdbms
{
uml() {
- p : Package
+ p : SimpleUML::Package[1]
|}
enforce rdbms() {
- realize s : Schema
+ realize s : SimpleRDBMS::Schema[1]
|}
where() {
- realize p2s : SimpleUML2RDBMS::PackageToSchema
+ realize p2s : SimpleUML2RDBMS::PackageToSchema[1]
|
p2s.umlPackage := p;
p2s.schema := s;
@@ -63,23 +63,23 @@
map primitiveToName in umlRdbms
{
- uml(p : Package
+ uml(p : SimpleUML::Package[1]
|) {
- prim : PrimitiveDataType
+ prim : SimpleUML::PrimitiveDataType[1]
|
prim.namespace = p;
}
check enforce rdbms() {
- sqlType : String
+ sqlType : String[1]
|}
- where(p2s : SimpleUML2RDBMS::PackageToSchema
+ where(p2s : SimpleUML2RDBMS::PackageToSchema[1]
|
p2s.umlPackage = p;) {
- realize p2n : SimpleUML2RDBMS::PrimitiveToName
+ realize p2n : SimpleUML2RDBMS::PrimitiveToName[1]
|
p2n.owner := p2s;
- p2n._primitive := prim;
+ p2n.primitive := prim;
p2n.typeName := sqlType;
}
}
@@ -94,7 +94,7 @@
}
where() {
- realize p2n : SimpleUML2RDBMS::IntegerToNumber
+ realize p2n : SimpleUML2RDBMS::IntegerToNumber[1]
|}
map
@@ -116,7 +116,7 @@
}
where() {
- realize p2n : SimpleUML2RDBMS::BooleanToBoolean
+ realize p2n : SimpleUML2RDBMS::BooleanToBoolean[1]
|}
map
@@ -138,7 +138,7 @@
}
where() {
- realize p2n : SimpleUML2RDBMS::StringToVarchar
+ realize p2n : SimpleUML2RDBMS::StringToVarchar[1]
|}
map
@@ -185,28 +185,28 @@
map classToTable in umlRdbms
{
- check enforce uml(p : Package
+ check enforce uml(p : SimpleUML::Package[1]
|) {
- realize c : Class
+ realize c : SimpleUML::Class[1]
|
c.kind := 'persistent';
c.namespace := p;
}
- check enforce rdbms(s : Schema
+ check enforce rdbms(s : SimpleRDBMS::Schema[1]
|) {
- realize t : Table
+ realize t : SimpleRDBMS::Table[1]
|
default t.kind := 'base';
t.schema := s;
t.kind <> 'meta';
}
- where(p2s : SimpleUML2RDBMS::PackageToSchema
+ where(p2s : SimpleUML2RDBMS::PackageToSchema[1]
|
p2s.umlPackage = p;
p2s.schema = s;) {
- realize c2t : SimpleUML2RDBMS::ClassToTable
+ realize c2t : SimpleUML2RDBMS::ClassToTable[1]
|
c2t.owner := p2s;
c2t.umlClass := c;
@@ -227,15 +227,14 @@
map
{
check enforce rdbms() {
- realize pk : Key,
- realize pc : Column
+ realize pk : SimpleRDBMS::Key[1],
+ realize pc : SimpleRDBMS::Column[1]
|
pk.owner := t;
pk.kind := 'primary';
pc.owner := t;
default pc.keys := OrderedSet(SimpleRDBMS::Key){pk};
default pc.type := 'NUMBER';
- pc.keys->includes(pk);
}
where() {
@@ -269,38 +268,37 @@
map associationToForeignKey in umlRdbms refines flattening
{
- check enforce uml(p : Package,
- sc : Class,
- dc : Class
+ check enforce uml(p : SimpleUML::Package[1],
+ sc : SimpleUML::Class[1],
+ dc : SimpleUML::Class[1]
|
sc.namespace = p;) {
- realize a : Association
+ realize a : SimpleUML::Association[1]
|
default a.source := sc;
default a.destination := dc;
default a.namespace := p;
}
- check enforce rdbms(s : Schema,
- st : Table,
- dt : Table,
- rk : Key
+ check enforce rdbms(s : SimpleRDBMS::Schema[1],
+ st : SimpleRDBMS::Table[1],
+ dt : SimpleRDBMS::Table[1],
+ rk : SimpleRDBMS::Key[1]
|
st.schema = s;
rk.owner = dt;
rk.kind = 'primary';) {
- realize fk : ForeignKey,
- realize fc : Column
+ realize fk : SimpleRDBMS::ForeignKey[1],
+ realize fc : SimpleRDBMS::Column[1]
|
fk.owner := st;
fc.owner := st;
fk.refersTo := rk;
default fc.foreignKeys := OrderedSet(SimpleRDBMS::ForeignKey){fk};
- fc.foreignKeys->includes(fk);
}
- where(p2s : SimpleUML2RDBMS::PackageToSchema,
- sc2t : SimpleUML2RDBMS::ClassToTable,
- dc2t : SimpleUML2RDBMS::ClassToTable
+ where(p2s : SimpleUML2RDBMS::PackageToSchema[1],
+ sc2t : SimpleUML2RDBMS::ClassToTable[1],
+ dc2t : SimpleUML2RDBMS::ClassToTable[1]
|
sc2t.owner = p2s;
p2s.umlPackage = p;
@@ -309,7 +307,7 @@
dc2t.table = dt;
sc2t.umlClass = sc;
dc2t.umlClass = dc;) {
- realize a2f : SimpleUML2RDBMS::AssociationToForeignKey
+ realize a2f : SimpleUML2RDBMS::AssociationToForeignKey[1]
|
a2f.owner := sc2t;
a2f.referenced := dc2t;
@@ -370,18 +368,18 @@
map attributes in umlRdbms refines flattening
{
- check enforce uml(c : Class
+ check enforce uml(c : SimpleUML::Class[1]
|) {
- realize a : Attribute
+ realize a : SimpleUML::Attribute[1]
|
default a.owner := c;
}
- where(fao : SimpleUML2RDBMS::FromAttributeOwner
+ where(fao : SimpleUML2RDBMS::FromAttributeOwner[1]
|) {
- realize fa : SimpleUML2RDBMS::FromAttribute
+ realize fa : SimpleUML2RDBMS::FromAttribute[1]
|
- fa._attribute := a;
+ fa.attribute := a;
fa.owner := fao;
}
@@ -398,7 +396,7 @@
map classAttributes in umlRdbms refines attributes
{
- where(fao : SimpleUML2RDBMS::ClassToTable
+ where(fao : SimpleUML2RDBMS::ClassToTable[1]
|
fao.umlClass = c;) {}
@@ -414,15 +412,15 @@
map primitiveAttribute in umlRdbms refines attributes
{
- check enforce uml(t : PrimitiveDataType
+ check enforce uml(t : SimpleUML::PrimitiveDataType[1]
|) {
a.type := t;
}
- where(p2n : SimpleUML2RDBMS::PrimitiveToName
+ where(p2n : SimpleUML2RDBMS::PrimitiveToName[1]
|
- p2n._primitive = t;) {
- realize fa : SimpleUML2RDBMS::AttributeToColumn
+ p2n.primitive = t;) {
+ realize fa : SimpleUML2RDBMS::AttributeToColumn[1]
|
fa.type := p2n;
}
@@ -438,13 +436,13 @@
map complexAttributeAttributes in umlRdbms refines attributes
{
- check uml(ca : Attribute
+ check uml(ca : SimpleUML::Attribute[1]
|
ca.type = c;) {}
- where(fao : SimpleUML2RDBMS::NonLeafAttribute
+ where(fao : SimpleUML2RDBMS::NonLeafAttribute[1]
|
- fao._attribute = ca;) {}
+ fao.attribute = ca;) {}
map
{
@@ -457,13 +455,13 @@
map complexAttribute in umlRdbms refines attributes
{
- check uml(t : Class
+ check uml(t : SimpleUML::Class[1]
|) {
a.type = t;
}
where() {
- realize fa : SimpleUML2RDBMS::NonLeafAttribute
+ realize fa : SimpleUML2RDBMS::NonLeafAttribute[1]
|}
map
@@ -504,19 +502,19 @@
map attributeColumns in umlRdbms
{
- check enforce rdbms(t : Table
+ check enforce rdbms(t : SimpleRDBMS::Table[1]
|) {
- realize c : Column
+ realize c : SimpleRDBMS::Column[1]
|
c.owner := t;
c.keys->size() = 0;
c.foreignKeys->size() = 0;
}
- where(c2t : SimpleUML2RDBMS::ClassToTable
+ where(c2t : SimpleUML2RDBMS::ClassToTable[1]
|
c2t.table = t;) {
- realize a2c : SimpleUML2RDBMS::AttributeToColumn
+ realize a2c : SimpleUML2RDBMS::AttributeToColumn[1]
|
a2c.column := c;
default a2c.owner := c2t;
@@ -526,9 +524,9 @@
map
{
- where(p2n : SimpleUML2RDBMS::PrimitiveToName
+ where(p2n : SimpleUML2RDBMS::PrimitiveToName[1]
|) {
- ct : String
+ ct : String[1]
|
a2c.type := p2n;
ct := c.type;
diff --git a/examples/org.eclipse.qvtd.examples.qvtrelation.hstm2fstm/src/org/eclipse/qvtd/examples/qvtrelation/hstm2fstm/HierarchicalStateMachine2FlatStateMachine.qvtr b/examples/org.eclipse.qvtd.examples.qvtrelation.hstm2fstm/src/org/eclipse/qvtd/examples/qvtrelation/hstm2fstm/HierarchicalStateMachine2FlatStateMachine.qvtr
index 5cf850d..2e2677f 100644
--- a/examples/org.eclipse.qvtd.examples.qvtrelation.hstm2fstm/src/org/eclipse/qvtd/examples/qvtrelation/hstm2fstm/HierarchicalStateMachine2FlatStateMachine.qvtr
+++ b/examples/org.eclipse.qvtd.examples.qvtrelation.hstm2fstm/src/org/eclipse/qvtd/examples/qvtrelation/hstm2fstm/HierarchicalStateMachine2FlatStateMachine.qvtr
@@ -26,7 +26,7 @@
/**
* Return the leafStates of a given hierarchicalState.
*/
- query getLeafStates(hierarchicalState : hierMM::State) : Set(hierMM::State) {
+ query getLeafStates(hierarchicalState : hierMM::State[1]) : Set(hierMM::State) {
hierarchicalState->closure(nestedStates)?->select(nestedStates->isEmpty())
}
@@ -66,8 +66,6 @@
*/
top relation HierachicalTransition2FlatTransition
{
- leafFromStates : Set(hierMM::State) = hierarchicalFromState->closure(nestedStates)->select(nestedStates->isEmpty());
- leafToStates : Set(hierMM::State) = hierarchicalToState->closure(nestedStates)->select(nestedStates->isEmpty());
leafFromState : hierMM::State;
leafToState : hierMM::State;
domain hier hierarchicalTransition : Transition {
@@ -86,8 +84,8 @@
HierachicalStateMachine2FlatStateMachine(hierarchicalStateMachine, flatStateMachine);
LeafState2FlatState(leafFromState, flatFromState);
LeafState2FlatState(leafToState, flatToState);
- leafFromStates->includes(leafFromState);
- leafToStates->includes(leafToState);
+ this.getLeafStates(hierarchicalFromState)->includes(leafFromState);
+ this.getLeafStates(hierarchicalToState)->includes(leafToState);
}
- }
+ }
}