Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Specify folder for resolving dsl model files?
Specify folder for resolving dsl model files? [message #1809626] Fri, 19 July 2019 05:55 Go to next message
Nicholas Johnson is currently offline Nicholas JohnsonFriend
Messages: 12
Registered: March 2017
Junior Member
Is there a way to specify a location to search for referenced model files?

I have 2 DSL models (ModelA and ModelB) based on different ecore models where ModelB depends on ModelA. I think I have the EMF part working well enough (for now). I'm trying to generate some output using Acceleo of ModelB but it can't resolve the reference to ModelA, I believe because the URI on the ModelA file is relative to my eclipse project layout which is different from the file system layout.

Here is the eclipse project layout (eclipse Navigator)
- Project1
--- My.ModelA
- Project2
--- My.ModelB

Here is the actual filesystem layout:
- FolderX
--- Project1
----- My.ModelA
- FolderY
--- Project2
----- My.ModelB

In ModelB, ModelA is referenced as href="../Project1/My.ModelA#...." but this causes a problem when I run the Acceleo generation (I'm using the Java Application Runner as using the Acceleo Plugin Application fails for other reasons I don't understand) . When I output the info about an object referenced from ModelA is says eProxyURI: FolderY/Project1/My.ModelA, which is wrong.

I can create a symlink to make the filesystem look like the expected eclipse project layout and that works, but I think what I would like is to have the reference in the DSL model file to be "flat" (i.e href="My.ModelA#....") and then be able to specify a list of search locations for the DSL models (search path = { FolderX/Project1, FolderY/Project2 })

I'm open to other suggestions as well.

I've messed with EMF/Acceleo a little but I still don't know very much. I've seen some posts mentioning the use of a platform URI (?) but I didn't fully understand what that meant. All that to say I might need some hand-holding.




Re: Specify folder for resolving dsl model files? [message #1809690 is a reply to message #1809626] Sat, 20 July 2019 10:15 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7673
Registered: July 2009
Senior Member
Hi

Yes it is possible, but unfortunately Acceleo's resolution of references is fundamentally unsound, since the treatment of 'platform:' as a virtual root while using Eclipse is not replicated when running standalone. It has been tweaked to make some common cases work, but IMHO it made the more general case worse and I had to adjust my references and overload malfunctioning routines. This was one of the reasons I am no longer an Acceleo user. If you want to solve the problem you may try using the org.eclipse.ocl.pivot.internal.resource.StandaloneProjectMap.initializeResourceSet() to initialize a ResourceSet so that accesses work sensibly, however you may need to override some Acceleo functionality to untweak the tweaks.

Regards

Ed Willink
Re: Specify folder for resolving dsl model files? [message #1809850 is a reply to message #1809690] Wed, 24 July 2019 19:05 Go to previous messageGo to next message
Nicholas Johnson is currently offline Nicholas JohnsonFriend
Messages: 12
Registered: March 2017
Junior Member
Hmmmm.. ok. I'll try to dig into that soon to see if I can make any progess. The symlink is working good enough for now and I got pulled off with other things as the Acceleo stuff is only worked on when I have "free time".


If I could ask, what are you using instead of Acceleo?

[Updated on: Wed, 24 July 2019 19:06]

Report message to a moderator

Re: Specify folder for resolving dsl model files? [message #1809867 is a reply to message #1809850] Thu, 25 July 2019 04:41 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7673
Registered: July 2009
Senior Member
Hi

5 years ago I migrated all the Acceleo templates for OCL support to Xtend.

For future work I may consider QVTo. See http://www.eclipse.org/mmt/qvt/docs/OCL2018TextM2M/TextM2M.pdf

Regards

Ed Willink
Previous Topic:Acceleo standalone generation
Next Topic:[acceleo] Standalone compiler (ant task)
Goto Forum:
  


Current Time: Fri Oct 04 18:18:57 GMT 2024

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

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

Back to the top