Home » Modeling » Epsilon » Loading an instanciated model via EGL loadModel
Loading an instanciated model via EGL loadModel [message #374164] |
Wed, 29 July 2009 12:21  |
Eclipse User |
|
|
|
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'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.
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
|
|
| |
Re: Loading an instanciated model via EGL loadModel [message #374726 is a reply to message #374164] |
Wed, 29 July 2009 13:11   |
Eclipse User |
|
|
|
Hi Darren,
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.
|
|
| |
Re: Loading an instanciated model via EGL loadModel [message #428059 is a reply to message #413457] |
Thu, 30 July 2009 10:20  |
Eclipse User |
|
|
|
Darren Clowes wrote:
> 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.
|
|
|
Re: Loading an instanciated model via EGL loadModel [message #571627 is a reply to message #374164] |
Wed, 29 July 2009 13:10  |
Eclipse User |
|
|
|
Hi there,
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.
|
|
|
Re: Loading an instanciated model via EGL loadModel [message #571654 is a reply to message #374164] |
Wed, 29 July 2009 13:11  |
Eclipse User |
|
|
|
Hi Darren,
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.
|
|
|
Re: Loading an instanciated model via EGL loadModel [message #571669 is a reply to message #374164] |
Thu, 30 July 2009 05:26  |
Eclipse User |
|
|
|
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
|
|
|
Re: Loading an instanciated model via EGL loadModel [message #571698 is a reply to message #571669] |
Thu, 30 July 2009 10:20  |
Eclipse User |
|
|
|
Darren Clowes wrote:
> 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.
|
|
|
Goto Forum:
Current Time: Tue Jul 22 18:57:28 EDT 2025
Powered by FUDForum. Page generated in 0.05399 seconds
|