Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsLoading an instanciated model via EGL loadModel
https://www.eclipse.org/forums/index.php/mv/msg/122586/374164/#msg_374164
Originally posted by: d.clowes.lboro.ac.uk
Hello All,
Knowing that Dimitris is away I was wondering if anyone else is able to
spot what I must be doing wrong.
I can load and query/traverse the metamodel in the examples and with my
own metamodels. My understanding of the Model Manager functions is that I
would do something like:
Where aPackageURI is the name of a package URI within the myMeta.ecore.
I assume I should then be able to access the EClasses by their name i.e.
myClass.all();
However I get an error of "Undefined variable, type or model:"
I have also trying using the AnyName as well to no success.
I am assuming that this is loading the model as if I do a EObject.all() I
can see the elements I'm trying to access. They do not exist under
anything other than EObject and I'm currently stumped as to how to get the
root class to start traversing the data. Any pointers/help is much
appreciated.
Darren]]>2009-07-29T16:21:12-00:00Re: Loading an instanciated model via EGL loadModel
https://www.eclipse.org/forums/index.php/mv/msg/122586/374725/#msg_374725
To be honest I have no experience in using Epsilon with Tomcat, but when
glancing at your message I thought perhaps you might need to include the
model name when attempting to access your objects, e.g.,
AnyName!myMetaClass.all. (and I wasn't sure from your message if you'd
tried this)
Sorry in advance if this isn't the problem (which it probably isn't :)).
Best,
Edd.]]>No real name2009-07-29T17:10:29-00:00Re: Loading an instanciated model via EGL loadModel
https://www.eclipse.org/forums/index.php/mv/msg/122586/571627/#msg_571627
To be honest I have no experience in using Epsilon with Tomcat, but when
glancing at your message I thought perhaps you might need to include the
model name when attempting to access your objects, e.g.,
AnyName!myMetaClass.all. (and I wasn't sure from your message if you'd
tried this)
Sorry in advance if this isn't the problem (which it probably isn't :)).
Best,
Edd.]]>No real name2009-07-29T17:10:29-00:00Re: Loading an instanciated model via EGL loadModel
https://www.eclipse.org/forums/index.php/mv/msg/122586/571654/#msg_571654
Reply hidden below...
Darren Clowes wrote:
> Hello All,
>
> Knowing that Dimitris is away I was wondering if anyone else is able to
> spot what I must be doing wrong.
>
> I'm trying to opertate on an instanciated model (*.model) via EGL in a
> TOMCAT environment (see
> http://code.google.com/p/epsilonlabs/wiki/EGLinTomcat)
>
> I can load and query/traverse the metamodel in the examples and with my
> own metamodels. My understanding of the Model Manager functions is that
> I would do something like:
>
> modelManager.registerMetaModel('myMeta.ecore');
> modelManager.loadModel('AnyName','myModel.model','aPackageUR I');
>
> Where aPackageURI is the name of a package URI within the myMeta.ecore.
All sounds correct so far!
>
> I assume I should then be able to access the EClasses by their name i.e.
>
> myClass.all();
>
> However I get an error of "Undefined variable, type or model:"
>
> I have also trying using the AnyName as well to no success.
Yes, you should be able to access all instances of "myClass" using "all".
I don't think this matters, but you could try using the property rather
than the method, like this:
myClass.all;
>
> I am assuming that this is loading the model as if I do a EObject.all()
> I can see the elements I'm trying to access. They do not exist under
> anything other than EObject and I'm currently stumped as to how to get
> the root class to start traversing the data. Any pointers/help is much
> appreciated.
Yes, loadModel should load and initialise your model. Could you send me
a minimal example of the failing behaviour? I'll see if I can recreate
the problem.
Cheers,
Louis.]]>Louis Rose2009-07-29T17:11:47-00:00Re: Loading an instanciated model via EGL loadModel
https://www.eclipse.org/forums/index.php/mv/msg/122586/374726/#msg_374726
Reply hidden below...
Darren Clowes wrote:
> Hello All,
>
> Knowing that Dimitris is away I was wondering if anyone else is able to
> spot what I must be doing wrong.
>
> I'm trying to opertate on an instanciated model (*.model) via EGL in a
> TOMCAT environment (see
> http://code.google.com/p/epsilonlabs/wiki/EGLinTomcat)
>
> I can load and query/traverse the metamodel in the examples and with my
> own metamodels. My understanding of the Model Manager functions is that
> I would do something like:
>
> modelManager.registerMetaModel('myMeta.ecore');
> modelManager.loadModel('AnyName','myModel.model','aPackageUR I');
>
> Where aPackageURI is the name of a package URI within the myMeta.ecore.
All sounds correct so far!
>
> I assume I should then be able to access the EClasses by their name i.e.
>
> myClass.all();
>
> However I get an error of "Undefined variable, type or model:"
>
> I have also trying using the AnyName as well to no success.
Yes, you should be able to access all instances of "myClass" using "all".
I don't think this matters, but you could try using the property rather
than the method, like this:
myClass.all;
>
> I am assuming that this is loading the model as if I do a EObject.all()
> I can see the elements I'm trying to access. They do not exist under
> anything other than EObject and I'm currently stumped as to how to get
> the root class to start traversing the data. Any pointers/help is much
> appreciated.
Yes, loadModel should load and initialise your model. Could you send me
a minimal example of the failing behaviour? I'll see if I can recreate
the problem.
Cheers,
Louis.]]>Louis Rose2009-07-29T17:11:47-00:00Re: Loading an instanciated model via EGL loadModel
https://www.eclipse.org/forums/index.php/mv/msg/122586/413457/#msg_413457
Originally posted by: d.clowes.lboro.ac.uk
Thanks gents,
I really don't know what I was doing now, but yesterday I could not get it
to work today all three:
myClass.all();
myClass.all;
doc1!myClass.all()
Seem to want to work. Thanks again for your responses, they have aided my
understanding some more too.
Darren]]>2009-07-30T09:26:02-00:00Re: Loading an instanciated model via EGL loadModel
https://www.eclipse.org/forums/index.php/mv/msg/122586/571669/#msg_571669
I really don't know what I was doing now, but yesterday I could not get it
to work today all three:
myClass.all();
myClass.all;
doc1!myClass.all()
Seem to want to work. Thanks again for your responses, they have aided my
understanding some more too.
Darren]]>Darren 2009-07-30T09:26:03-00:00Re: Loading an instanciated model via EGL loadModel
https://www.eclipse.org/forums/index.php/mv/msg/122586/428059/#msg_428059
> Thanks gents,
>
> I really don't know what I was doing now, but yesterday I could not get
> it to work today all three:
>
> myClass.all();
> myClass.all;
> doc1!myClass.all()
>
> Seem to want to work. Thanks again for your responses, they have aided
> my understanding some more too.
Just a little more explanation on this issue...
When a name is defined by two or more loaded metamodels, the fully
qualified syntax, modelName!typeName is required. When EOL can infer the
metamodel of a class (e.g. when there's only one metamodel loaded),
there's no need to qualify the class name with the modelName! prefix.
A little while ago, the method all() was added as a synonym for the
property all.
Consequently, all 3 of the statements above should work. However, as
this integration with Tomcat is new, do let us know if you have any
problems -- there may be bugs to squash!
Cheers,
Louis.]]>Louis Rose2009-07-30T14:20:11-00:00Re: Loading an instanciated model via EGL loadModel
https://www.eclipse.org/forums/index.php/mv/msg/122586/571698/#msg_571698
> Thanks gents,
>
> I really don't know what I was doing now, but yesterday I could not get
> it to work today all three:
>
> myClass.all();
> myClass.all;
> doc1!myClass.all()
>
> Seem to want to work. Thanks again for your responses, they have aided
> my understanding some more too.
Just a little more explanation on this issue...
When a name is defined by two or more loaded metamodels, the fully
qualified syntax, modelName!typeName is required. When EOL can infer the
metamodel of a class (e.g. when there's only one metamodel loaded),
there's no need to qualify the class name with the modelName! prefix.
A little while ago, the method all() was added as a synonym for the
property all.
Consequently, all 3 of the statements above should work. However, as
this integration with Tomcat is new, do let us know if you have any
problems -- there may be bugs to squash!