One source multiple targets [message #1842229] |
Sun, 13 June 2021 14:49  |
Eclipse User |
|
|
|
Hi Dimitris,
I am encountering an issue with my metamodels (they are quite big), which I actually cannot reproduce with a minimal example, but I will try to explain it.
In the source metamodel I have a "Path", while in the target metamodel, I have "FirstPath" and "IntermediatePath". Paths are contained in "City" in both metamodels.
I write two transformations rules:
Path2FirstPath
Path2IntermediatePath
The difference is what locations they connect and I added that in their guards. However, when I add them to the City2City transformation rule like this:
rule City2City
transform s:Source!City
to t:Target!City {
t.name=s.name;
t.firstPath::=s.path;
t.intermediatePath::=s.path;
}
I get
An internal error occurred during: "Launching transformation".
java.lang.NullPointerException
And in the console I get
Quote:
org.xtext.example.test.Test.impl.IntermediatePathImpl
If I switch places of the firstPath and intermediatePath inside the City transformations rule as follows:
rule City2City
transform s:Source!City
to t:Target!City {
t.name=s.name;
t.intermediatePath::=s.path;
t.firstPath::=s.path;
}
I get
An internal error occurred during: "Launching transformation".
java.lang.NullPointerException
And in the console I get
Quote:
org.xtext.example.test.Test.impl.FirstPathImpl
So I get issues with the second one always.
I truly cannot find what is wrong, and I was wondering, maybe it is not allowed to have two of these statements, where the source is the same?
Quote:
t.intermediatePath::=s.path;
t.firstPath::=s.path;
PS. The target metamodel, is generated, from a grammar written in Xtext.
Would appreciate any help you could give me.
Many thanks,
Tomas!
|
|
|
|
Re: One source multiple targets [message #1842252 is a reply to message #1842236] |
Mon, 14 June 2021 10:38   |
Eclipse User |
|
|
|
Hi Dimitris,
I tried as much as possible to create a minimal example, so that I can get the same mistake and you can reproduce it locally and I do here.
So attached I am sending you the Zip files (didn't do this through the Epsilon playground, as some things that work there do not work in Eclipse).
The zip file contains FirstInstance, in which the XText files (target metamodel) are located, and the SecondInstance, where the source metamodel, the models and the transformation is located.
I start getting errors as soon as I add paths in the source model.
This is the error that I am getting now, with the files that I am sending you.
org.xtext.example.textual.textual.impl.PathImpl
Many thanks,
Best Tomas
Attachment: Forest.zip
(Size: 1.75MB, Downloaded 120 times)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: One source multiple targets [message #1842831 is a reply to message #1842830] |
Fri, 02 July 2021 05:47  |
Eclipse User |
|
|
|
I don't think that continuing this discussion cross-forum is a good idea. If you can get your code to work in Java, please let me know.
Best,
Dimitris
[Updated on: Fri, 02 July 2021 05:53] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04738 seconds