Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [Complete OCL] Correct way of importing referred metamodels
[Complete OCL] Correct way of importing referred metamodels [message #1022350] Thu, 21 March 2013 18:09 Go to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 156
Registered: October 2009
Senior Member

Hello,

If my metamodel references other metamodels, what is the correct way of importing and using them in a Complete OCL document?

Currently I am suing:

import 'http://www.eclipse.org/qvt/0.9/QVTcoreBase'
import 'http://www.eclipse.org/qvt/0.9/QVTcore'


Where QVTCore references elements in the QVTcoreBase metamodel, and it seems to work. I would assume that then, I would need two separate package sections to define context restrictions:

package qvtcore

context Mapping

...

endpackage

package qvtcorebase

context CoreDomain
	
...
	
endpackage


However, if I use this method the CoreDomain context is not recognized, although the quick fix suggests replacing it for CoreDomain.

If I put all the contexts in the qvtcore package the error goes away.

But if I now lunch an eclipse instance from my environment and open the complete OCL, things works the other way round. That is, the single package generates errors and the separate package approach does not.

Can it be something related to the way the imported metamodels are resolved?

(I have attached screenshots with the errors)
  • Attachment: OCLForum.zip
    (Size: 140.09KB, Downloaded 54 times)


Horacio Hoyos Rodriguez
EngD Student
University Of York
Re: [Complete OCL] Correct way of importing referred metamodels [message #1022406 is a reply to message #1022350] Thu, 21 March 2013 20:03 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4188
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi<br>
<br>
I suspect that you have not yet installed QVTd M6 that provides
QVTcoreBase from<br>
<br>
Update site: <a class="moz-txt-link-freetext"
href="http://download.eclipse.org/mmt/qvtd/updates/milestones">http://download.eclipse.org/mmt/qvtd/updates/milestones</a>
<br>
Downloadable zips: <a class="moz-txt-link-freetext"
href="http://www.eclipse.org/mmt/downloads/?project=qvtd">http://www.eclipse.org/mmt/downloads/?project=qvtd</a>
<br>
<br>
import '<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.eclipse.org/qvt/0.9/QVTcoreBase">http://www.eclipse.org/qvt/0.9/QVTcoreBase</a>'
references the installed/plugin/Java package whose nsURI is
specified.<br>
<br>
Use<br>
<br>
import
'platform:/resource/org.eclipse.qvtd.pivot.qvtcorebase/model/QVTcoreBase.ecore'::qvtcorebase<a
moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.eclipse.org/qvt/0.9/QVTcoreBase"></a> to access a
package in a project model.<br>
<br>
&nbsp;&nbsp;&nbsp; Regards<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Ed<br>
<br>
<br>
On 21/03/2013 18:09, Horacio Hoyos wrote:
<blockquote cite="mid:kificr$ncg$1@xxxxxxxxe.org" type="cite">
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-family: -moz-fixed; font-size: 14px;"
lang="x-western">
<pre wrap="">import '<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.eclipse.org/qvt/0.9/QVTcoreBase">http://www.eclipse.org/qvt/0.9/QVTcoreBase</a>'
import '<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.eclipse.org/qvt/0.9/QVTcore">http://www.eclipse.org/qvt/0.9/QVTcore</a>'

Where QVTCore references elements in the QVTcoreBase metamodel, and it seems to work. I would assume that then, I would need two separate package sections to define context restrictions:

package qvtcore

context Mapping

...

endpackage

package qvtcorebase

context CoreDomain

...

endpackage

However, if I use this method the CoreDomain context is not recognized, although the quick fix suggests replacing it for CoreDomain.

If I put all the contexts in the qvtcore package the error goes away.

But if I now lunch an eclipse instance from my environment and open the complete OCL, things works the other way round. That is, the single package generates errors and the separate package approach does not.

Can it be something related to the way the imported metamodels are resolved?

(I have attached screenshots with the errors)
</pre>
</div>
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-family: -moz-fixed; font-size: 14px;"
lang="x-western">
<pre wrap=""><div class="moz-txt-sig">--
Horacio Hoyos Rodriguez
EngD Student
University Of York
</div></pre>
</div>
</blockquote>
<br>
</body>
</html>
Previous Topic:[Announce] Eclipse OCL 4.1.0 (Kepler) M6 is now available.
Next Topic:OCL Constraint in ecore model
Goto Forum:
  


Current Time: Sun Dec 21 13:02:49 GMT 2014

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

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