Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » A problem with model transformations with element deletions on dependent models
A problem with model transformations with element deletions on dependent models [message #1752842] Sat, 28 January 2017 12:48 Go to next message
Eclipse UserFriend
Hello,

I have experienced a problem regarding to the application of model transformations with element deletions on dependent models.

I have a graph metamodel, called SimpleGraphMetamodel(.ecore). I have another metamodel that is an extension of the graph metamodel, called SimpleGraphMetamodel_loopExtension(.ecore), to denote distinguish the loops in the related graph model.

First, I create an instance of graph metamodel, called ExampleModel_original.sgmm. This graph includes a loop. Following this, I create an instance of the extension, called ExampleModel_extension_original.sgmme, which points to the single loop.

Second, I apply a transformation to replace two nodes in the graph model with a replacement node. These two nodes are in the loop. I update the graph model; and also its extension model accordingly. If I traverse, or print the details of both models, during the transformation; everything seems fine. The problem is, once the transformation is complete, the files of the models are not consistent anymore. The extension model file refers to non-existing elements of the model file.

I have provided the minimal example for this problem. The models with "_original" are the initial models. The models with "_after_transformation" are the models after transformation. The transformation is applied with read-on-load and store-on-disposal options enabled for both models.

A minimal example is attached.

Note: It is not always easy to replicate the errors in minimal examples, this time, the minimal example reflects the problem Smile .
Re: A problem with model transformations with element deletions on dependent models [message #1752891 is a reply to message #1752842] Mon, 30 January 2017 11:22 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Bugra,

Let me know if the answer in https://www.eclipse.org/forums/index.php/t/1083929/ helps with this. If not, please also attach a stored launch configuration for your transformation and I will investigate.

Cheers,
Dimitris
Re: A problem with model transformations with element deletions on dependent models [message #1752900 is a reply to message #1752891] Mon, 30 January 2017 12:38 Go to previous messageGo to next message
Eclipse UserFriend
Hello Dimitris,

The transformation runs without any problem through ANT file when I add expand="true". However, the models after the result are still inconsistent.

You can find a screenshot from the launch configuration in the documentation folder. I also attach it. You can find a screenshot of the inconsistency in the documentation folder.

I wonder if the following is the main reason of this problem: For the metamodels that do not have an attribute with ID = true, the (inter-)model dependencies are represented with relative references in the underlying XML such as 5. node element's 1. outgoing edge. If there is a deletion, this order changes but the Epsilon transformation does not update the relative references in the model files (During the execution of the transformation, everything works fine).

The external model reference handling maybe handles only the metamodel defining some attributes ID = true.
Re: A problem with model transformations with element deletions on dependent models [message #1752901 is a reply to message #1752900] Mon, 30 January 2017 12:46 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Bugra,

I've tried to run your transformation but I'm getting a java.lang.IndexOutOfBoundsException in line 40 (InSGMMModel!Node.allInstances().select( n | n.name = "D").at(0)), which is expected as there's no "D" node in the input model. Could you please provide an exception-free example?

Cheers,
Dimitris

[Updated on: Mon, 30 January 2017 12:46]

Report message to a moderator

Re: A problem with model transformations with element deletions on dependent models [message #1753018 is a reply to message #1752901] Wed, 01 February 2017 07:44 Go to previous messageGo to next message
Eclipse UserFriend
Hello Dimitris,

I realize I forget to describe how to run it. ExampleModel_extension_original.sgmme and ExampleModel_original.sgmm are there as the first/initial versions of the models. You create copies of these models as ExampleModel_extension_after_transformation.sgmme and ExampleModel_after_transformation.sgmm. These ...after_transformation... models will be the inputs of the transformation. Then, you run the transformation.

Two screenshots showing the model files before and after transformation are provided in the documentation folder.

Thank you.
Re: A problem with model transformations with element deletions on dependent models [message #1753038 is a reply to message #1753018] Wed, 01 February 2017 10:23 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Bugra,

I'm not sure I understand your instructions. Could you please provide an updated minimal example where I can simply run a stored launch configuration and reproduce the problem you're encountering?

Cheers,
Dimitris
Re: A problem with model transformations with element deletions on dependent models [message #1753044 is a reply to message #1753038] Wed, 01 February 2017 12:07 Go to previous messageGo to next message
Eclipse UserFriend
I have attached the minimal example again. You can only run it once since the transformation changes-overrides the input models. To run it again, you must replace the files in the model folder with the files in models_backup folder.

The configuration file is included in the configuration folder.

The documentation folder has two screenshots showing the problem visually.
Re: A problem with model transformations with element deletions on dependent models [message #1753102 is a reply to message #1753044] Wed, 01 February 2017 20:22 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Bugra,

This is a bug in the Epsilon EMF bridge which has been fixed in [1]. Could you please try with a fresh interim version in a couple of hours? (Hudson needs a bit of time to build a new interim version)

Cheers,
Dimitris

[1] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/commit/?id=cf561ff94bb93a13f0aae498f05c0492d374a430
Re: A problem with model transformations with element deletions on dependent models [message #1753115 is a reply to message #1753102] Wed, 01 February 2017 23:43 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Bugra,

This has revealed a regression with allOfType/allOfKind caching [1] so the latest interim version is unlikely to be any good (unless you turn off caching in all your models). I'll post an update when the regression has been fixed. Apologies for any inconvenience caused.

Cheers,
Dimitris

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=511514
Re: A problem with model transformations with element deletions on dependent models [message #1753140 is a reply to message #1752842] Thu, 02 February 2017 07:59 Go to previous message
Eclipse UserFriend
No problem Dimitris,

I am happy that it helps to improve Epsilon.

In the meanwhile, we have applied a metamodel change to include an attribute with unique XML id value for the elements in the metamodel. So, instead of relative references, we have solved the problem with id references.
Previous Topic:Problem with running ETL in ANT
Next Topic:A problem with model loading of models
Goto Forum:
  


Current Time: Thu Mar 28 14:20:47 GMT 2024

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

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

Back to the top