Cross reference problem with ETL [message #989289] |
Wed, 05 December 2012 09:41  |
Eclipse User |
|
|
|
hi
I have two model where one references the other. I am having problems
getting a value from the model that is referenced in ETL.
This is a snip of the meta model that is loaded with ETL:
class Port
{
String name
PortType ^type
refers DataType dataType
}
the other meta model contains:
<eClassifiers xsi:type="ecore:EClass" name="DataType"
eSuperTypes="#//AbstractElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SimpleType"
eSuperTypes="#//DataType"/>
This is the model snip:
Port Out {
type OUT
dataType "data.int"
}
and the other model:
dataTypeLibrary data {
simpleType int
}
where "data.int" is assigned to Datatype.name (verified using debugger
and seeing that the model is properly instantiated)
so... when I do this part of ETL:
rule BundleToPackage
transform source : Source!Bundle
to target : Target!Package {
....
for (aPort in component.ports) {
if (aPort.type == PortType#OUT) {
var publisher = new Target!Publisher;
publisher.name = aPort.name;
if (aPort.datatype.isTypeOf(Source!DataType)) {
publisher.msg = aPort.datatype.name;
}
node.publisher.add(publisher);
}
....
The aPort.name has a correct value.
I did the type check just for testing.
The value of aPort.datatype.name is always null.
Is there something I am doing wrong? Is this a bug?
-H
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29603 seconds