Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Avoiding 'import' in CompleteOclEditor using OCL Registry?(Configuration of Infrastructure)
icon5.gif  Avoiding 'import' in CompleteOclEditor using OCL Registry? [message #839646] Mon, 09 April 2012 02:25 Go to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

This is probably a real beginners question, so please bear with me...

I have a piece of OCL source code to type-check against an Ecore metamodel. I have opened the file in the text-based Complete OCL editor. The editor obviously cannot resolve the types, so it grumbles at me.

It seems that I can fix this using the non-standard 'import' directive, and here is my issue:

My metamodel is defined in a different plugin, and I would like to include the types from there. The only larger CompleteOCL example (RoyalAndLoyal) solves this with a relative URL and has the ecore in the same package. Other examples pass the package programmatically. I do not want to use either approach. Ideally, I would like to avoid 'import' completely.

I have found the OCL model registry in the properties of the file and assume that the models registered (defined for) a source code file would provide its type checking context. But there is no documentation for the registry and I do not find its use self-evident...

So here is the question:
Can the model registry be used to make the type space of an Ecore model available in the Complete OCL Editor?
If so, how is this done? (sample code)

I assume this question may be common, as the editor has become the default for .ocl files...

Thanks,

JGS
Re: Avoiding 'import' in CompleteOclEditor using OCL Registry? [message #839649 is a reply to message #839646] Mon, 09 April 2012 02:30 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Update, for those searching. Platform protocol works as shown in this pattern 'platform:/resource/net.jgsuess.xxx/model/xxx.ecore'
Re: Avoiding 'import' in CompleteOclEditor using OCL Registry? [message #839725 is a reply to message #839646] Mon, 09 April 2012 05:23 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The OCL (formerly QVTd, formerly UMLX) Model Registry
(http://www.eclipse.org/gmt/umlx/doc/EclipseAndOMG08/ModelRegistry.pdf)
was introduced initially to solve the model location problem for models
that have only a nickname. The Registry additionally solved a dynamic
URI mapping problem as well.

I now regard the nickname only access of OCL, QVT Core and QVT
Relational as language bugs. Using a separate meta-data repository just
hides the problem. The new editors therefore prototype proposed language
changes.

I now regard problems with URI resolution as tooling issues. EMF has
flexible support through registered URIs such as 'http:....', and
normalized URIs such as 'platform:/resource/....' and
'platform:/plugin/....'. There are few difficulties using this support
within Eclipse, and the difficulties of using this support in a
standalone environment seem to be due to a missing EMF helper class (see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=361063) and UML2 support
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=364419).

An attempt to make the OCL Model Registry of general use as an EMF Model
Registry did not find favour as the problem did not seem to be a problem
to other modeling tools.

The OCL Model Registry therefore seems to be the wrong solution and is
likely to be terminated rather than promoted.

Regards

Ed Willink

On 09/04/2012 03:25, Jörn Guy Sü Missing name wrote:
> This is probably a real beginners question, so please bear with me...
>
> I have a piece of OCL source code to type-check against an Ecore
> metamodel. I have opened the file in the text-based Complete OCL
> editor. The editor obviously cannot resolve the types, so it grumbles
> at me.
>
> It seems that I can fix this using the non-standard 'import'
> directive, and here is my issue:
>
> My metamodel is defined in a different plugin, and I would like to
> include the types from there. The only larger CompleteOCL example
> (RoyalAndLoyal) solves this with a relative URL and has the ecore in
> the same package. Other examples pass the package programmatically. I
> do not want to use either approach. Ideally, I would like to avoid
> 'import' completely.
>
> I have found the OCL model registry in the properties of the file and
> assume that the models registered (defined for) a source code file
> would provide its type checking context. But there is no documentation
> for the registry and I do not find its use self-evident...
>
> So here is the question:
> Can the model registry be used to make the type space of an Ecore
> model available in the Complete OCL Editor?
> If so, how is this done? (sample code)
>
> I assume this question may be common, as the editor has become the
> default for .ocl files...
>
> Thanks,
>
> JGS
Previous Topic:How define an ocl expression on type of an object
Next Topic:allInstances, unrecognized variable
Goto Forum:
  


Current Time: Thu Mar 28 14:33:03 GMT 2024

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

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

Back to the top