Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Edapt] Edapt validation for earlier releases([Edapt] Edapt validation for earlier releases)
[Edapt] Edapt validation for earlier releases [message #1743189] Tue, 13 September 2016 07:22 Go to next message
Balazs Pinke is currently offline Balazs PinkeFriend
Messages: 3
Registered: September 2016
Junior Member
Hi,

We have several persisted files of our model, but with different versions. There can be several issues with the files (manual updates, while attributes already changed). I need a solution where I could validate the different versions (releases) of these files before the Edapt migration like I can do within a custom migration with model.checkConformance().

Is there any (planned or existing) solution for doing that?

Best Regards,
Balazs
Re: [Edapt] Edapt validation for earlier releases [message #1743571 is a reply to message #1743189] Fri, 16 September 2016 13:24 Go to previous messageGo to next message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 70
Registered: December 2013
Member
Hi,

I am not sure if I fully understand your problem: When a migration is performed model.checkConformance() is called after the model has been loaded for the first time. As I understood your problem, this is what you want to achieve?

Moreover it is possible to set a different validation level (see org.eclipse.emf.edapt.internal.migration.execution.ValidationLevel) on the migrator with the #setLevel method, so you could tell edapt to check the confirmance after any change.
Also, since a CustomMigration does not have to be attached to any metamodel change, you could also add a check conformance migration at the beginning of every release.

Kind regards
Johannes


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [Edapt] Edapt validation for earlier releases [message #1743731 is a reply to message #1743571] Mon, 19 September 2016 10:06 Go to previous messageGo to next message
Balazs Pinke is currently offline Balazs PinkeFriend
Messages: 3
Registered: September 2016
Junior Member
Hi Johannes,

Thanks for your reply!
Basically I would like to reach the functionality of the checkConformance() method before the migration is being executed! In this way I could get the list of all the issues within the given file (in an earlier version/release) without migrating it, which would fail right after the first issue.

Kind regards,
Balazs
Re: [Edapt] Edapt validation for earlier releases [message #1743846 is a reply to message #1743731] Tue, 20 September 2016 08:46 Go to previous messageGo to next message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 70
Registered: December 2013
Member
Hi,
I haven't tested it, but the following should work.
After you have created a Migrator and before starting the migration you can call
org.eclipse.emf.edapt.migration.execution.Migrator.getMetamodel(Release)
The Migrator also offers methods to access the Release you need, e.g. based on a NS-URI.
You can get the NS-URI with org.eclipse.emf.edapt.migration.ReleaseUtils.getNamespaceURI(URI).

Then you can use
org.eclipse.emf.edapt.internal.migration.internal.Persistency.loadModel(URI, Metamodel, IResourceSetFactory)
to get a Model instance on which you can call #checkConformance().

I hope this will help.
Cheers
Johannes


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [Edapt] Edapt validation for earlier releases [message #1744076 is a reply to message #1743846] Thu, 22 September 2016 08:44 Go to previous message
Balazs Pinke is currently offline Balazs PinkeFriend
Messages: 3
Registered: September 2016
Junior Member
Hi Johannes,

Thank you very much for your help, it is exactly what I wanted to achieve!
The loadModel however might throw MigratorException, what I need to handle, but if it is not causing any issue, I can check the conformance of the old versions as well.

Thank you,
Balazs
Previous Topic:[EMF Forms] Implement check on data input
Next Topic:[ECP] Two Implementations Avoids IllegalArgumentException: The class ... is not a valid classifier
Goto Forum:
  


Current Time: Thu Nov 23 02:08:33 GMT 2017

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

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