Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EDAPT] Edapt in a Spring application
[EDAPT] Edapt in a Spring application [message #1802408] Fri, 08 February 2019 12:24 Go to next message
Jerome Wirth is currently offline Jerome WirthFriend
Messages: 2
Registered: February 2019
Junior Member
I'm relatively new to the EDAPT topic, but I try my best to explain the problem.

We have a Spring Boot Application, that uses an EMF-Modell. The model changed over time and now we would like to add a migrator for old models. It sounds perfect for EDAPT, but it seems that EDAPT is only usable within eclipse applications?

It's hard to find resources for the EDAPT project, besides the project page itself, that's why I ask here:

Is it possible to add EDAPT to an Spring Application? Till now I was able to create the history for my ecore-Model, but when I want to load a migrator its always null because there is no eclipse platform running.

On the other hand, I tried to register my own migrator, but I don't know how and the only other example I found for this, needed a running eclipse platform too.
Re: [EDAPT] Edapt in a Spring application [message #1802517 is a reply to message #1802408] Mon, 11 February 2019 09:52 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 94
Registered: September 2016
Member
Hi,

EDAPT relies on mechanisms such as extension points, which require at least an OSGi runtime to be started. It would probably be possible to abstract the migration behavior in a way with some effort. Please let us know if you are interested in contributing or sponsoring this refactoring.
Do you currently run EMF stand alone in Sprint without OSGi?

Best regards,
Jonas


--
Jonas Helming
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EDAPT] Edapt in a Spring application [message #1802697 is a reply to message #1802517] Thu, 14 February 2019 08:35 Go to previous messageGo to next message
Jerome Wirth is currently offline Jerome WirthFriend
Messages: 2
Registered: February 2019
Junior Member
Exactly, currently we have a Spring Application, with a JavaFX UI that uses an EMF-Model to work with its data.

I've been thinking for some time now to contribute to open source projects, but till now I didn't had the courage to do it. The refactoring would be a great opportunity, but I would need some guidance with it.

Best regards,
Jérôme
Re: [EDAPT] Edapt in a Spring application [message #1802890 is a reply to message #1802697] Mon, 18 February 2019 14:27 Go to previous message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 92
Registered: December 2013
Member

Hi,

you can get the source code and setup an IDE as described here:
https://www.eclipse.org/edapt/communication.php

Code-wise the entry point would be
org.eclipse.emf.edapt.migration.execution.Migrator.main(String[])
and
org.eclipse.emf.edapt.internal.migration.execution.internal.MigratorCommandLine.MigratorCommandLine(String[])
which is the constructor that parses the arguments passed to this Migrator main method.

Using this plain java application you may migrate models without an osgi-runtime. However this is not well tested and there are missing features (e.g. passing in custom EFactories is only supported from an extension point as of now). It should work for simple use cases.

If you need to fix or extend something, the best way to submit any patches is Gerrit:
https://wiki.eclipse.org/Gerrit#User_Account
https://wiki.eclipse.org/Gerrit#Gerrit_setup

Also note, that you can also contribute additional documentation. Simply open a bugzilla (https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Edapt) and attach your extension.

If you have questions about something, best thing would be to ask here, to open a bugzilla , or to push your changes to Gerrit and we can discuss it there.

Cheers,
Johannes


Example usage:
String[] args = new String[] { //
		"\"/home/user/model.xmi\"", // file path to model which needs to be migrated

		"-h", "\"/home/user/myplugin/model/task.history\"", // file path to the history

		"-s", "0", // source release
		"-t", "1", // target release
		"-v", "CUSTOM_MIGRATION", // validation level

		// operation libraries
		"-l", "org.eclipse.emf.edapt.internal.declaration.BaseLibrary", //
		"-l", "org.eclipse.emf.edapt.declaration.delegation.DelegationOperations", //
		"-l", "org.eclipse.emf.edapt.declaration.generalization.GeneralizationOperations", //
		"-l", "org.eclipse.emf.edapt.declaration.inheritance.InheritanceOperations", //
		"-l", "org.eclipse.emf.edapt.declaration.merge.MergeOperations", //
		"-l", "org.eclipse.emf.edapt.declaration.simple.NonStructuralPrimitives", //
		"-l", "org.eclipse.emf.edapt.declaration.replacement.ReplacementOperations", //
		"-l", "org.eclipse.emf.edapt.declaration.creation.StructuralPrimitives", };
Migrator.main(args);


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:[EMF Forms] Problem with rendering of Collapsible Group
Next Topic:Edapt doesn't do specialize reference type while ecore migration changes
Goto Forum:
  


Current Time: Fri Sep 20 22:25:15 GMT 2019

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

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

Back to the top