Element shown twice in target metamodel [message #1842837] |
Fri, 02 July 2021 12:22 |
Tomas Wall Messages: 53 Registered: April 2021 |
Member |
|
|
Hi Dimitris,
I am writing the following transformations available here https://www.eclipse.org/epsilon/live/?af4dc61e
and I am encountering some issues,
When I create an "InitialArea" in the source model, in the target model, it should first create an "InitialPath"as a container and then put the "InitialArea" inside. That works fine!
In another scenario, in the source model the user can create a "Path", where the "sourceLocation" is "InitialArea" and this will be transformed into an "InitialPath" because the sourceLocation is "InitialArea"and it is specified in the guard of the transformation.
Now my issue is this:
If in the source model the user creates a "Path" P1 and an "InitialArea" A1, and says that the "sourceLocation" is IA1, the transformation will create two initial paths, but I want it to create only one.
For that reason I added the following if condition:
if (not s.paths.sourceLocation.isTypeOf(Source!InitialArea)){
var it: new Target!InitialPath;
t.initialpath::=it;
it.initialarea::=s.initial;
}
I expected this to only create the InitialPath as a container for InitialArea, when it cannot find another transition in which the sourceLocation is an InitialArea.
However, it does not seem to make a difference. Is there another syntax to this, or the logic might be wrong?
Thank you!
Best,
Tomas
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03134 seconds