Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Cross reference problem with ETL
Cross reference problem with ETL [message #989289] Wed, 05 December 2012 14:41 Go to next message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 11
Registered: July 2009
Junior Member
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
Re: Cross reference problem with ETL [message #989342 is a reply to message #989289] Wed, 05 December 2012 17:53 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 310
Registered: January 2010
Senior Member
Just to be sure: you're using aPort.datatype in the ETL script but your snippet of the metamodel uses "dataType" as the name of the attribute. Is that a typo in the post, or in the ETL script?
Re: Cross reference problem with ETL [message #989460 is a reply to message #989342] Thu, 06 December 2012 10:12 Go to previous messageGo to next message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 11
Registered: July 2009
Junior Member
On 12/05/2012 06:53 PM, Antonio Garcia-Dominguez wrote:
> Just to be sure: you're using aPort.datatype in the ETL script but your
> snippet of the metamodel uses "dataType" as the name of the attribute.
> Is that a typo in the post, or in the ETL script?

Changing the syntax doesn’t solve the problems.

-H
Re: Cross reference problem with ETL [message #989475 is a reply to message #989460] Thu, 06 December 2012 11:45 Go to previous messageGo to next message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 11
Registered: July 2009
Junior Member
On 12/06/2012 11:12 AM, Hugo A. Garcia wrote:
> On 12/05/2012 06:53 PM, Antonio Garcia-Dominguez wrote:
>> Just to be sure: you're using aPort.datatype in the ETL script but your
>> snippet of the metamodel uses "dataType" as the name of the attribute.
>> Is that a typo in the post, or in the ETL script?
>
> Changing the syntax doesn’t solve the problems.
>
> -H

This is what happens when I do println();

println("* = " + aPort.dataType);
println("** = " + aPort.datatype);

* = org.best_of_robotics.dsl.datatypes.impl.DataTypeImpl@fb0c124
(eProxyURI: file:/home/hugo/ipa/runtime-foobar
one/one.bcmx#xtextLink_::0.0.0.1.0::2::/11)org.eclipse.epsilon.eol.types.EolNoType$EolNoTypeInstance@1b01ade9

** = org.best_of_robotics.dsl.datatypes.impl.DataTypeImpl@fb0c124
(eProxyURI:
file:/home/hugo/ipa/runtime-foobar/one/one.bcmx#xtextLink_::0.0.0.1.0::2::/11)org.eclipse.epsilon.eol.types.EolNoType$EolNoTypeInstance@1b01ade9

while doing

println("* = " + aPort.dataType.name);
println("** = " + aPort.datatype.name);

outputs:

* = org.eclipse.epsilon.eol.types.EolNoType$EolNoTypeInstance@1b01ade9
** = org.eclipse.epsilon.eol.types.EolNoType$EolNoTypeInstance@1b01ade9

-H
Re: Cross reference problem with ETL [message #989874 is a reply to message #989475] Sat, 08 December 2012 23:34 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 310
Registered: January 2010
Senior Member
Could you post the rest of the code of your ETL rule? I'd need to see how component.ports is initialized.
Previous Topic:[EGL] How to access to enums of a model
Next Topic:[EGL] Create a folder
Goto Forum:
  


Current Time: Mon Dec 22 10:09:26 GMT 2014

Powered by FUDForum. Page generated in 0.01759 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software