ETL Transformation incase of more than one package [message #1094980] |
Mon, 26 August 2013 13:26 |
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 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.02365 seconds