Model Elemenet Types: "!" vs. "::" [message #582450] |
Mon, 02 November 2009 13:35  |
Eclipse User |
|
|
|
I am totally confused on the real diffrence between the two model element types character separator.
I was doing a simple model to model transformation. I have 2 ecore metamodles, and an epsilon model. I made a simple etl rule to test the transformation and, following the Tree2Graph example, used the ! character to separate elements. I kept getting a "Typed not found error" so I decided to try with the :: separator. So now the elements of the input metamodel where recognized but the ones form the output one not. So I changed the one for the output to ! and it all worked out.
So... when or how to know when to use one or the other? Does it has to do with some property of the metamodel ?
Thanks,
Horacio Hoyos
|
|
|
Re: Model Elemenet Types: "!" vs. "::" [message #582466 is a reply to message #582450] |
Mon, 02 November 2009 18:14  |
Eclipse User |
|
|
|
Hi Horacio,
Apologies for the delayed response.
In Epsilon A!X.all returns all the instances of EClass X in model A. If
you omit ! and just write X.all it will return all the instances of X in
the first model of the launch configuration (useful when you have only
one model, e.g. in model validation). By contrast, :: is a package
separator that helps you to fully qualify names. For example if your
Ecore metamodel reads like this:
package foo {
package bar {
class X{}
}
class X{}
}
A!foo::bar::X.allInstances will return all the instances of the first X
EClass in model A while A!foo::X.allInstances will return all instances
of the second X EClass in model A.
If your metamodel reads like this (no ambiguity)
package foo {
package bar {
class X{}
}
}
A!X.allInstances will still return all the instances of X (there is no
need to specify the full foo::bar::X path).
I hope this helps. If not please let me know and I'll be happy to
provide further clarifications.
Cheers,
Dimitris
Horacio wrote:
> I am totally confused on the real diffrence between the two model
> element types character separator.
>
> I was doing a simple model to model transformation. I have 2 ecore
> metamodles, and an epsilon model. I made a simple etl rule to test the
> transformation and, following the Tree2Graph example, used the !
> character to separate elements. I kept getting a "Typed not found error"
> so I decided to try with the :: separator. So now the elements of the
> input metamodel where recognized but the ones form the output one not.
> So I changed the one for the output to ! and it all worked out.
>
> So... when or how to know when to use one or the other? Does it has to
> do with some property of the metamodel ?
>
> Thanks,
>
> Horacio Hoyos
|
|
|
Powered by
FUDForum. Page generated in 0.04042 seconds