Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Element shown twice in target metamodel
Element shown twice in target metamodel [message #1842837] Fri, 02 July 2021 12:22 Go to next message
Tomas Wall is currently offline Tomas WallFriend
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
Re: Element shown twice in target metamodel [message #1842859 is a reply to message #1842837] Sat, 03 July 2021 08:35 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Tomas,

s.paths.sourceLocation always returns a sequence (because s.paths is multi-valued) and never a Source!InitialArea.

Best,
Dimitris
Re: Element shown twice in target metamodel [message #1842973 is a reply to message #1842859] Thu, 08 July 2021 11:06 Go to previous messageGo to next message
Tomas Wall is currently offline Tomas WallFriend
Messages: 53
Registered: April 2021
Member
Hi Dimitris,

Thank you for the answer. In this case, is there a way to write the condition so that this piece of code is ran only when there does not exist a path where the sourceLocation is an InitialArea?

Thanks,
Tomas!
Re: Element shown twice in target metamodel [message #1842992 is a reply to message #1842973] Fri, 09 July 2021 04:33 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Tomas,

I'm sure there is. If you can produce a more meaningful example (e.g. what is an InitialArea or an InitialPath?), I'd be happy to have a closer look and advise further.

Best,
Dimitris
Previous Topic:How to validate only part of model
Next Topic:[ETL] Accessing specific output of a transformation rule
Goto Forum:
  


Current Time: Sat Apr 27 05:47:09 GMT 2024

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

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

Back to the top