Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Refering to UML concepts from EMF model(Refering to UML concepts from EMF model)
Refering to UML concepts from EMF model [message #990246] Tue, 11 December 2012 15:02 Go to next message
Erlend Stav is currently offline Erlend Stav
Messages: 5
Registered: September 2012
Junior Member
We have a scenario where we would like to refer to elements of a UML model from elements of an EMF model we are defining. Is there any recommended way to do this?

To be more concrete, we have a UML model (using some UML profiles) that define an ontology. In EMF we are defining a model for describing services, where the service operations should include references to the ontology concepts that they have an effect on.

One approach we are considering is to load the UML meta-model as a resource in our EMF meta-model, and then import the concepts we need (e.g. UML Property), and create relations from our EMF concepts to the UML concepts.

Some concrete questions?
1. Is the above approach in general the right idea?
2. How do we import the UML meta-model so that the references to it are valid? In the Load Resource dialog there is no direct option for selecting "installed" meta-models (just Browse File System... and Browse Workspace...).
3. Does this approach cause any problems e.g. with generating editors using Extended Editing Framework?

Best regards,

- Erlend
Re: Refering to UML concepts from EMF model [message #990347 is a reply to message #990246] Wed, 12 December 2012 05:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Erlend,

Comments below.

On 11/12/2012 7:13 PM, Erlend Stav wrote:
> We have a scenario where we would like to refer to elements of a UML
> model from elements of an EMF model we are defining. Is there any
> recommended way to do this?
You mean you want an EReference whose EClass refers to one from the UML
model?
>
> To be more concrete, we have a UML model (using some UML profiles)
> that define an ontology. In EMF we are defining a model for describing
> services, where the service operations should include references to
> the ontology concepts that they have an effect on.
Profiles as I understand them are just Ecore models...
> One approach we are considering is to load the UML meta-model as a
> resource in our EMF meta-model, and then import the concepts we need
> (e.g. UML Property), and create relations from our EMF concepts to the
> UML concepts.
Yes, that sounds reasonable.
>
> Some concrete questions? 1. Is the above approach in general the right
> idea?
Yes.
> 2. How do we import the UML meta-model so that the references to it
> are valid? In the Load Resource dialog there is no direct option for
> selecting "installed" meta-models (just Browse File System... and
> Browse Workspace...).
Hmmm. Maybe I'm confused. You want your instances to refer to UML
models, not your model itself? The Sample Ecore Editor has an extended
resource dialog that allows you to load registered Ecore models, such as
UML's Ecore model.
> 3. Does this approach cause any problems e.g. with generating editors
> using Extended Editing Framework?
I think you need the latest service release of UML2 because the Juno
release had a problem with references to a "built-in types" Ecore model...
>
> Best regards,
>
> - Erlend
Re: Refering to UML concepts from EMF model [message #990430 is a reply to message #990347] Wed, 12 December 2012 13:24 Go to previous messageGo to next message
Erlend Stav is currently offline Erlend Stav
Messages: 5
Registered: September 2012
Junior Member
Thanks for your quick and good answers, Ed.

It would probably be a good idea that the Load resource dialogs in the .ecorediag also included the browsing of registered resources.

With the setup described, the references works ok also with the generated standard editors generated from EMF.

The Extended Editing Framework does not seem to handle the references, though. When I try to generate using "Initialize EEF Editor", the resulting src-gen directory of the project is empty. It does generate a new .edit and .editor directory, but these only contain a single class each. There is no error-message provided. Could this be related to the error you mention in 3 ? I'm using SR1 of Juno Modeling Tools, and have done installed all updates available from "check for updates".
Re: Refering to UML concepts from EMF model [message #990453 is a reply to message #990430] Wed, 12 December 2012 15:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Erlend,

Comments below.

On 12/12/2012 2:24 PM, Erlend Stav wrote:
> Thanks for your quick and good answers, Ed.
>
> It would probably be a good idea that the Load resource dialogs in the
> .ecorediag also included the browsing of registered resources.
Yes, so I added it recently (along with support for diagrams for *.xcore
models).
>
> With the setup described, the references works ok also with the
> generated standard editors generated from EMF.
>
> The Extended Editing Framework does not seem to handle the references,
> though. When I try to generate using "Initialize EEF Editor", the
> resulting src-gen directory of the project is empty. It does generate
> a new .edit and .editor directory, but these only contain a single
> class each. There is no error-message provided. Could this be related
> to the error you mention in 3 ? I'm using SR1 of Juno Modeling Tools,
> and have done installed all updates available from "check for updates".
I'm not sure the fix was in SR1 but I think you would have seen the
problem with EMF GenModel already, so maybe it is... Maybe EEF depends
on the EEF stuff for UML2 being generated...
Re: Refering to UML concepts from EMF model [message #990461 is a reply to message #990453] Wed, 12 December 2012 15:30 Go to previous messageGo to next message
Erlend Stav is currently offline Erlend Stav
Messages: 5
Registered: September 2012
Junior Member
I have experimented a bit more, and it seems that there is a general problem with generating the EEF editors if you reference any other model from the ecore model. In my experiment I created a small example with a generated EEF editor that works fine (for simplicity, lets call it Ex1 containing class A). Then I create Ex2 which imports A from Ex1 and which defines class B which have a reference to A. The loading of Ex1 from Ex2 was done by browsing the workspace in this case.

This setup causes the same problem as for the import of UML case - i.e., when using "Initialize EEF Editor" the .genmodel is created but the src-gen (that appears) is empty, and again the src-gen of the .edit and .editor projects end up with a single class (...EditPlugin and ...EditorPlugin). The models files under the .edit project are created, but the .components models contain only the root entry with no sub-content.

Any ideas? Are imports supported at all in EEF?
Re: Refering to UML concepts from EMF model [message #990472 is a reply to message #990461] Wed, 12 December 2012 16:04 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Erlend,

I'd suggest you post a question prefixed with [EEF] and attach your
small self-contained example that doesn't work.

On 12/12/2012 4:30 PM, Erlend Stav wrote:
> I have experimented a bit more, and it seems that there is a general
> problem with generating the EEF editors if you reference any other
> model from the ecore model. In my experiment I created a small example
> with a generated EEF editor that works fine (for simplicity, lets call
> it Ex1 containing class A). Then I create Ex2 which imports A from Ex1
> and which defines class B which have a reference to A. The loading of
> Ex1 from Ex2 was done by browsing the workspace in this case.
>
> This setup causes the same problem as for the import of UML case -
> i.e., when using "Initialize EEF Editor" the .genmodel is created but
> the src-gen (that appears) is empty, and again the src-gen of the
> .edit and .editor projects end up with a single class (...EditPlugin
> and ...EditorPlugin). The models files under the .edit project are
> created, but the .components models contain only the root entry with
> no sub-content.
> Any ideas? Are imports supported at all in EEF?
Re: Refering to UML concepts from EMF model [message #990480 is a reply to message #990472] Wed, 12 December 2012 16:19 Go to previous message
Erlend Stav is currently offline Erlend Stav
Messages: 5
Registered: September 2012
Junior Member
Thanks - I have now posted a question under the EMFT forum with the [EEF] prefix.
Previous Topic:[CDO]Rollback in DBStore NullPointerException
Next Topic:[CDO] IllegalStateException during attempts to reconnect
Goto Forum:
  


Current Time: Sun Sep 21 06:11:09 GMT 2014

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

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