Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Loading an instanciated model via EGL loadModel
Loading an instanciated model via EGL loadModel [message #374164] Wed, 29 July 2009 16:21 Go to next message
Eclipse UserFriend
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 #374725 is a reply to message #374164] Wed, 29 July 2009 17:10 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 92
Registered: July 2009
Member
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 #374726 is a reply to message #374164] Wed, 29 July 2009 17:11 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
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 #413457 is a reply to message #374164] Thu, 30 July 2009 09:26 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Loading an instanciated model via EGL loadModel [message #428059 is a reply to message #413457] Thu, 30 July 2009 14:20 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
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 17:10 Go to previous message
No real name is currently offline No real nameFriend
Messages: 92
Registered: July 2009
Member
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 17:11 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
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 09:26 Go to previous message
Darren  is currently offline Darren Friend
Messages: 40
Registered: September 2009
Member
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 14:20 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
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.
Previous Topic:Loading an instanciated model via EGL loadModel
Next Topic:[EGL] [newbie] Multiple input models problem
Goto Forum:
  


Current Time: Mon Nov 24 03:10:44 GMT 2014

Powered by FUDForum. Page generated in 0.07087 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software