Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [OCLinEcore] Import using metamodel URI(URI vs path)
[OCLinEcore] Import using metamodel URI [message #1008722] Wed, 13 February 2013 18:02 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 6
Registered: July 2010
Junior Member
Hi!

I am currently working with the OCLinEcore-Editor and have a question how to reference other metamodels using the import-Statement.

Currently there are have two plugin-projects "ProjectA" and "ProjectB". Both projects have a metamodel, while ProjectB's metamodel references ProjectA's metamodel.

See the following example for ProjectB's metamodel:
import projecta : '../../ProjectA/model/projectAModel.ecore#/'; 
--does not work, when the model is not already registered:
--   import projecta : 'http://i.am.projecta/1.0';
import ecore_0 : 'http://www.eclipse.org/emf/2002/Ecore#/';

package  b : b = 'http://i.am.projectb/1.0' {
	
	class Foo {
		property bar : projecta::Bar;	
	}
	
}

When working on the two plugins, both of the following scenarios are possible:
1) Both projects are in one workspace. To work on ProjectB's metamodel, I have to reference ProjectA's metamodel by its location/path (as shown in the code snippet above).
2) Plugin ProjectA is already loaded. To work on ProjectB's metamodel I have to change the import to reference the URI of ProjectA's metamodel.

Obviously, changing the imports depending on the workspace configuration is not what I want. I appreciate any kind of help or comments.

Thank you very much!
Kind Regards.
Re: [OCLinEcore] Import using metamodel URI [message #1008746 is a reply to message #1008722] Wed, 13 February 2013 19:06 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You should find that platform:/resource/... paths preferentially use
files in open projects over files in installed plugins.

Regards

Ed Willink


On 13/02/2013 18:02, Missing name Mising name wrote:
> Hi!
>
> I am currently working with the OCLinEcore-Editor and have a question
> how to reference other metamodels using the import-Statement.
>
> Currently there are have two plugin-projects "ProjectA" and
> "ProjectB". Both projects have a metamodel, while ProjectB's metamodel
> references ProjectA's metamodel.
>
> See the following example for ProjectB's metamodel:
> import projecta : '../../ProjectA/model/projectAModel.ecore#/'; --does
> not work, when the model is not already registered:
> -- import projecta : 'http://i.am.projecta/1.0';
> import ecore_0 : 'http://www.eclipse.org/emf/2002/Ecore#/';
>
> package b : b = 'http://i.am.projectb/1.0' {
>
> class Foo {
> property bar : projecta::Bar;
> }
>
> }
> When working on the two plugins, both of the following scenarios are
> possible:
> 1) Both projects are in one workspace. To work on ProjectB's
> metamodel, I have to reference ProjectA's metamodel by its
> location/path (as shown in the code snippet above).
> 2) Plugin ProjectA is already loaded. To work on ProjectB's metamodel
> I have to change the import to reference the URI of ProjectA's metamodel.
>
> Obviously, changing the imports depending on the workspace
> configuration is not what I want. I appreciate any kind of help or
> comments.
>
> Thank you very much!
> Kind Regards.
Previous Topic:Property::CompatibleInitialiser' constraint is not satisfied
Next Topic:oclIsTypeOf/oclIsKindOf, OclVoid and OclInvalid
Goto Forum:
  


Current Time: Thu Apr 18 06:27:54 GMT 2024

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

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

Back to the top