Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Wrong Uris in the target model
Wrong Uris in the target model [message #1849184] Thu, 06 January 2022 13:54 Go to next message
Torben Eckwert is currently offline Torben EckwertFriend
Messages: 2
Registered: January 2022
Junior Member
I'm trying to transform an emf model into another one where the target model references elements from the source model. Therefore I created an atl plugin with the transformation file. I allowed inter-model references.

Now I'm facing the issue that the href attributes in the target model contain absolute paths instead of relative ones.

I would expect the following outcome:
<elemetA href="../folder/model.modelA#//@elemetA.2"/>

instead I get this result:

<elemetA href="C:\Users\myName\myDocuments\eclipse-modeling-2020-06\runtime-EclipseApplication\project_name\folder\model.modelA#//@elemetA.2"/>

The listing shows the section of my rule.
from
elementA: ModelA!ElementA
to
b: ModelB!ElementB (
name <- elementA.description,
elementA<- elementA

)

The absolute path leads to an exception if I try to open the target model with the generated model editor:
java.net.MalformedURLException: unknown protocol: c
at java.base/java.net.URL.<init>(URL.java:652)
at java.base/java.net.URL.<init>(URL.java:541)
at java.base/java.net.URL.<init>(URL.java:488)
at org.eclipse.emf.ecore.resource.impl.URIHandlerImpl.createInputStream(URIHandlerImpl.java:199)
...

Thanks for your help!
Re: Wrong Uris in the target model [message #1849216 is a reply to message #1849184] Sat, 08 January 2022 23:36 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

This is likely due to the fact that the target model's underlying EMF Resource does not have a (real) URI set (and is likely saved to an OutputStream). You would have to check your (generated?) plugin code for this. If your target model's EMF Resource has a URI set that starts with the same prefix as the references input models' Resources, then EMF can use relative paths in its references.

Cheers,
Dennis
Re: Wrong Uris in the target model [message #1849265 is a reply to message #1849216] Mon, 10 January 2022 15:45 Go to previous message
Torben Eckwert is currently offline Torben EckwertFriend
Messages: 2
Registered: January 2022
Junior Member
Thanks for your answer, it helped me a lot. You were right. One of my URIs was not correct.
Previous Topic:String express
Next Topic:Applying Profiles and stereotypes
Goto Forum:
  


Current Time: Thu Apr 18 19:59:45 GMT 2024

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

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

Back to the top