Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Add Pacakge imports to the OclParser
Add Pacakge imports to the OclParser [message #534917] Thu, 20 May 2010 15:34 Go to next message
Eclipse UserFriend
Originally posted by: philipp.berger.student.hpi.uni-potsdam.de

Hey guys,
I just tried to parse an OCL expression like
....self.oclAsType(MyType1)..., so I got a type not found exception,
which I could fix by giving the full qualified name of the class
....self.oclAsType(org::packageTwo::MyType1)...

This constraint is defined for an EClass in PackageOne, this package has
no references to PackageTwo, but I like to handle subclasses from
PackageTwo in the constraint.

This problem occured while using the org.eclipse.emf.importer.rose for
porting models. In the Rose context all expressions are defined without
full qualified names, but after importing the class visibility seems to
be changed.


So my question, is it possible to bind severall packages to the
OclParser to avoid full qualified names?
Re: Add Pacakge imports to the OclParser [message #534950 is a reply to message #534917] Thu, 20 May 2010 18:38 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4150
Registered: July 2009
Senior Member
Hi Philipp

You don't make clear whether you are using a CompleteOCL document or a
casual EssentialOCL query.

For an EssentialOCL query it is your responsibility/capability to
configure the package registry, so it may be possible with some
imagination, but probably requires a lookup algorithm change.

For CompleteOCL, http://www.omg.org/issues/issue14599.txt suggests the
addition of an import declaration, although I had envisaged that

import 'uri'

would load a meta-model, requiring full package qualification.

The OCL specification makes extensive (almost exclusive) use of
unqualified names so perhaps:

import 'uri#/Package1'

should make Package1::Type1 avaialable as just Type1 and

import myuri : 'uri#/Package1'

should make Package1::Type1 available as just myuri::Type1.

The new Xtext editor supports the latter.

Regards

Ed Willink

On 20/05/2010 16:34, Philipp Berger wrote:
> Hey guys,
> I just tried to parse an OCL expression like
> ....self.oclAsType(MyType1)..., so I got a type not found exception,
> which I could fix by giving the full qualified name of the class
> ....self.oclAsType(org::packageTwo::MyType1)...
>
> This constraint is defined for an EClass in PackageOne, this package has
> no references to PackageTwo, but I like to handle subclasses from
> PackageTwo in the constraint.
>
> This problem occured while using the org.eclipse.emf.importer.rose for
> porting models. In the Rose context all expressions are defined without
> full qualified names, but after importing the class visibility seems to
> be changed.
>
>
> So my question, is it possible to bind severall packages to the
> OclParser to avoid full qualified names?
Previous Topic:OCL constraint: blank character in a string
Next Topic:EConstraint in Ecore Model
Goto Forum:
  


Current Time: Sun Nov 23 05:57:19 GMT 2014

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

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