|trouble with nested packages [message #501102]
||Tue, 01 December 2009 04:11
| Jim Steel
Registered: July 2009
I'm having some trouble with nested packages. I have a metamodel for a
language that's fairly big, so has been broken up into several nested
packages. I've given the top-level package the nsURI
http://express.ecore, then the subpackages nsURI values like
http://express.ecore#//core and so on.
My problem comes when I am trying to process models instantiated using
this metamodel. My processing program (a model transformation engine, so
not specific to my express metamodel) loads up the top-level ecore file
(the transformation basically has an import statement), and retrieves
one of the EClasses I'm interested in, but when it tries to do a
comparison (specifically an isInstance() call) with an object as loaded
in from the model, the classes are incompatible. Specifically, the model
object, under reflection, is an instance of an EClass coming from
http://express.ecore#//core The transformation engine, though, loaded
up http://express.ecore and navigated down to find the EClass by name in
a subpackage, and ended up with a different EClass object.
Does that make sense? What am I doing wrong? Have I set up my model
wrongly (in terms of nsURIs for the different packages)? Is the
transformation engine doing something wrong?