Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » How to import a library
How to import a library [message #1784096] Thu, 22 March 2018 13:01 Go to next message
Francesco Bedini is currently offline Francesco BediniFriend
Messages: 3
Registered: March 2018
Junior Member
I have this content in eDSPNConstructors().qvto
modeltype EDSPN "strict" uses eDSPN(".../eDSPN");

library eDSPNConstructors(){

property randomSequence:Sequence(Integer) = Sequence{1,2,3,4,5,6,7,8,9};

/** Constructors **/
constructor Label::Label(given_text : String) {
   ...
}
}


Then in another file:

modeltype UML "strict" uses uml("http://www.eclipse.org/uml2/5.0.0/UML");
modeltype EDSPN "strict" uses eDSPN(".../eDSPN");

transformation AS2UPetriNetTransformation(in uml:UML, out net:EDSPN) extends library eDSPNConstructors();


I get the error: "Can't resolve module reference 'eDSPNConstructors'"
The file are both located into a "transforms" folder that is set as the QVT source container in the QVT Settings.

I also tried:
extends eDSPNConstructors();


Any idea? Does it make any sense to divide the helpers, query and constructors in different files?
Re: How to import a library [message #1784099 is a reply to message #1784096] Thu, 22 March 2018 14:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6109
Registered: July 2009
Senior Member
HI

I'm afraid that I have never used the library construct, but the QVTo JUnit tests have many examples of the form:

library SomeName;

The spec references as "extends SomeName" rather than your "extends library SomeName".

If you have many helpers, query and constructors separate files might be appropriate, but I would tend to modularize by partial model rather than implementation functionality.

Regards

Ed Willink
Re: How to import a library [message #1784202 is a reply to message #1784099] Fri, 23 March 2018 13:45 Go to previous messageGo to next message
Francesco Bedini is currently offline Francesco BediniFriend
Messages: 3
Registered: March 2018
Junior Member
I've found my problem, the
import libraryName;

at the beginning of the file using the library was missing.

Then the extends can be either with or without library.

Thanks for your help, to the next undocumented feature :)
Re: How to import a library [message #1784210 is a reply to message #1784202] Fri, 23 March 2018 14:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6109
Registered: July 2009
Senior Member
No Message Body
Re: How to import a library [message #1784212 is a reply to message #1784210] Fri, 23 March 2018 14:28 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6109
Registered: July 2009
Senior Member
Hi

So the "Can't resolve module reference 'eDSPNConstructors'" was 100% accurate.

You need to post fuller repros to avoid answers going off at a tangent.

Regards

Ed Willink
Previous Topic:Running a QVT transformation headless or from JUnit
Next Topic:a wrong with qvt
Goto Forum:
  


Current Time: Wed Nov 14 06:24:55 GMT 2018

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

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

Back to the top