Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » ETL Transformation incase of more than one package
ETL Transformation incase of more than one package [message #1094980] Mon, 26 August 2013 13:26 Go to next message
Chandrakana Nandi
Messages: 12
Registered: August 2013
Junior Member
Hello,

I am using ETL for model transformation. I have two meta models. However, one of them has more than one package. I am not sure how to access the classes of this metamodel. Here is a small example:

@namespace(uri="model1", prefix="model1")

package model1;

abstract class PlaceHolder
{
}

@namespace(uri="model1/abc/1.0", prefix="model1.abc")
package abc
{
class PlaceHolder
{
}

@namespace(uri="model1/abc/def/1.0", prefix="model1.abc.def")
package def
{
class PlaceHolder
{
}

@namespace(uri="model1/abc/def/main/1.0", prefix="model1.abc.def.main")
package main
{
class PlaceHolder
{
}

@namespace(uri="model1/abc/def/main/types/1.0", prefix="model1.abc.def.main.types")
package types
{

class Atom extends Component
{
attr String name ;

}
}}}


could you please tell me if the following is the correct way of writing it:

rule model1_to_model2
transform m1:model1!Atom
to m2:model2!Block
{
m2.identity=m1.name;
}


the consufion I have is in line : transform m1:model1!Atom
Since the class Atom actually belongs to package types which is nested, so I was not sure how to access this class.

I will be very grateful if someone can kindly help me out.

Sincere regards,
Chandrakana








Re: ETL Transformation incase of more than one package [message #1095711 is a reply to message #1094980] Tue, 27 August 2013 12:24 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 886
Registered: July 2009
Senior Member
Hi,

Using sub-packages is generally not advisable [1]. In any event, if a type name is unique (e.g. Atom), the Epsilon EMF driver will locate it even if it's located in a sub-package, so your code should work fine as it stands. For non-unique type names, you'll need to qualify them using the name of their container EPackage (e.g. model1::abc::Placeholder). I hope this helps.

Cheers,
Dimitris
Re: ETL Transformation incase of more than one package [message #1095737 is a reply to message #1095711] Tue, 27 August 2013 13:04 Go to previous message
Chandrakana Nandi
Messages: 12
Registered: August 2013
Junior Member
Thank you so much Dimitri, it helped a lot Smile

Best,
Chandrakana
Previous Topic:attribute representation like magicdraw
Next Topic:testing a transformation
Goto Forum:
  


Current Time: Sat Oct 25 00:49:10 GMT 2014

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

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