|
|
|
Re: Only recognise the first model type [message #1847167 is a reply to message #1847151] |
Sun, 17 October 2021 20:47 |
John Henbergs Messages: 239 Registered: October 2020 |
Senior Member |
|
|
Hi Ed,
So I tried out somethings, and apparently the issue was not with the "strict" keyword, but because the two metamodels, have concepts with the same names. So I have the following:
modeltype A "strict" uses A('http://....');
modeltype B "strict" uses B('http://....');
transformation test(in srcModel:A out trgModel:B;
main() {
srcModel.rootObjects()[Root] -> map R2R();
}
mapping Root :: R2R() : Root{
name:=self.name;
}
When I hover above the first and second Root, I get
Quote:
A::Root
in both cases. When I check the possible alternatives, I only get one Root. So if the metamodels have concepts with same name, the only alternative I get, is the concept that is part of the metamodel that is defined first as a model type. For now the only way I could find around this was to change the names of the concepts in one of the metamodels, so they are not the same, but I was wondering if there is another solution to it, as it is not feasible to change the names of the model elements (I just tried that to see if that is the issue).
Than you in advance!
[Updated on: Sun, 17 October 2021 20:48] Report message to a moderator
|
|
|
|
Re: Only recognise the first model type [message #1847174 is a reply to message #1847167] |
Mon, 18 October 2021 07:22 |
Christopher Gerking Messages: 115 Registered: April 2011 |
Senior Member |
|
|
Hi John
John Henbergs wrote on Sun, 17 October 2021 16:47So if the metamodels have concepts with same name, the only alternative I get, is the concept that is part of the metamodel that is defined first as a model type.
If I understand you correctly, both metamodels A and B have a class called Root? In that case, you should use fully qualified names to access Root. Basically, you've already given the solution yourself:
Quote:
A::Root
If you want to access Root from the first metamodel, write A::Root. For the second metamodel, write B::Root.
I agree with Ed that a repro would be helpful, especially if the problem is something completely different than what I expect.
Kind regards
Christopher
|
|
|
Powered by
FUDForum. Page generated in 0.03273 seconds