Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [xtext] "EPackage is used twice" or How to import several packages of the same ecore model
[xtext] "EPackage is used twice" or How to import several packages of the same ecore model [message #536933] Mon, 31 May 2010 14:32 Go to next message
Eclipse UserFriend
Originally posted by: kuehnlenz.informatik.hu-berlin.de

Hi,

My existing ecore model has several packages:
- root_package
-- package_A
-- package_B
-- package_C

and within package A classes from package B and C are referenced.

Now I used the project creation wizard "Xtext Project From Existing
Ecore Models" with the root_package as default package.

The generated xtext file contains now three imports:

import "platform:/resource/testProject/test.ecore" as package_A
import "platform:/resource/testProject/test.ecore" as package_B
import "platform:/resource/testProject/test.ecore" as package_C

But there are error messages on that import statements:
"EPackage [...] is used twice."

What I have to do in order to import/use several packages of the same
ecore model?

Thanks in advance,
Frank
Re: [xtext] "EPackage is used twice" or How to import several packages of the same ecore m [message #537035 is a reply to message #536933] Tue, 01 June 2010 06:24 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
(replying to eclipse.modeling.tmf, which is where Xtext is discussed)

Frank Kuehnlenz schrieb:
> Hi,
>
> My existing ecore model has several packages:
> - root_package
> -- package_A
> -- package_B
> -- package_C
>
> and within package A classes from package B and C are referenced.
>
> Now I used the project creation wizard "Xtext Project From Existing
> Ecore Models" with the root_package as default package.

If you can split them up, i.e. one file per EPackage, I strongly suggest
to do so. Nested packages tend to complicate things.

>
> The generated xtext file contains now three imports:
>
> import "platform:/resource/testProject/test.ecore" as package_A
> import "platform:/resource/testProject/test.ecore" as package_B
> import "platform:/resource/testProject/test.ecore" as package_C

That's a bug in the wizard (please file a bug report).
You need to add the fragment part to the URIs. They should looke like
this:

platform:/resource/testProject/test.ecore#//package_A

Sven

--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: [xtext] "EPackage is used twice" or How to import several packages of the same ecore m [message #622960 is a reply to message #536933] Tue, 01 June 2010 06:24 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
(replying to eclipse.modeling.tmf, which is where Xtext is discussed)

Frank Kuehnlenz schrieb:
> Hi,
>
> My existing ecore model has several packages:
> - root_package
> -- package_A
> -- package_B
> -- package_C
>
> and within package A classes from package B and C are referenced.
>
> Now I used the project creation wizard "Xtext Project From Existing
> Ecore Models" with the root_package as default package.

If you can split them up, i.e. one file per EPackage, I strongly suggest
to do so. Nested packages tend to complicate things.

>
> The generated xtext file contains now three imports:
>
> import "platform:/resource/testProject/test.ecore" as package_A
> import "platform:/resource/testProject/test.ecore" as package_B
> import "platform:/resource/testProject/test.ecore" as package_C

That's a bug in the wizard (please file a bug report).
You need to add the fragment part to the URIs. They should looke like
this:

platform:/resource/testProject/test.ecore#//package_A

Sven

--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Previous Topic:[xtext] "EPackage is used twice" or How to import several packages of the same ecore model
Next Topic:Light weight modelling framework
Goto Forum:
  


Current Time: Thu Mar 28 08:32:43 GMT 2024

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

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

Back to the top