Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Edapt issues when ecores extend one another(i can not make Edapt work in 2 use cases )
Edapt issues when ecores extend one another [message #870609] Wed, 09 May 2012 01:01 Go to next message
Dmitry Volchegursky is currently offline Dmitry VolchegurskyFriend
Messages: 2
Registered: March 2012
Junior Member
guys,
Can you help me out to understand if it is possible to use Edapt in following use cases to transform the models. Is it possible to bypass these issues programmatically. Or maybe using work around.
the diagram describing the two use cases is attached.
Use case 1.


In this use case I have 2 ecores ecore2 extends ecore1. Edapt works fine in case I need to transform models of ecore2. It is possible to create a single history file that will contain changes to both ecore1 and ecore2. The transformation will determine if any changes are needed based on ecore2\model2_instance namespace and the transformation will work fine. However if I need to migrate ecore1 models I can not since it is not possible to create separate history for it that will reference ecore2 history changes to ecore1 and bind it to ecore1 namespace. Otherwise no migrator is associated with ecore1 models to migrate the model.

Use case 2.

In this use case ecore1 is extended by ecore3 and ecore2. A history file can be created for both ecore2 and ecore3 however ecore1 can be part of only one history file for ecore2 or ecore3. And as a result of this it is not possible to migrate ecore3 models correctly since it does not contain the changes to ecore1.

[Updated on: Wed, 09 May 2012 01:04]

Report message to a moderator

Re: Edapt issues when ecores extend one another [message #870840 is a reply to message #870609] Wed, 09 May 2012 20:32 Go to previous messageGo to next message
Markus Herrmannsdoerfer is currently offline Markus HerrmannsdoerferFriend
Messages: 50
Registered: July 2009
Member
Hi Dmitry,

Am 09.05.2012 03:02, schrieb Dmitry Volchegursky:
> guys,
> Can you help me out to understand if it is possible to use Edapt in
> following use cases to transform the models. Is it possible to bypass
> these issues programmatically. Or maybe using work around.
>
> Use case 1.
>
>
> In this use case I have 2 ecores ecore2 extends ecore1. Edapt works fine
> in case I need to transform models of ecore2. It is possible to create a
> single history file that will contain changes to both ecore1 and ecore2.
> The transformation will determine if any changes are needed based on
> ecore2\model2_instance namespace and the transformation will work fine.
> However if I need to migrate ecore1 models I can not since it is not
> possible to create separate history for it that will reference ecore2
> history changes to ecore1 and bind it to ecore1 namespace. Otherwise no
> migrator is associated with ecore1 models to migrate the model.

That is true. Currently, it only works for both ecore models, if there
is a single history. I was thinking a lot about splitting the histories
of several ecore files. However, if there is an operation spanning
several histories, to which history should the operation be associated?
Until now, I found no simple solution that provides this feature. If you
have an idea, do not hesitate to propose it.

> Use case 2.
>
> In this use case ecore1 is extended by ecore3 and ecore2. A history file
> can be created for both ecore2 and ecore3 however ecore1 can be part of
> only one history file for ecore2 or ecore3. And as a result of this it
> is not possible to migrate ecore3 models correctly since it does not
> contain the changes to ecore1.

If you have a history for both ecore1 and ecore2, you can add ecore3 to
that history by selecting Edapt -> Add Metamodel to History in the
context menu of the resource by which ecore3 is contained. Then you will
get one history file for ecore1, ecore2 and ecore3. You can always check
whether the history is fine by selecting Edapt -> Check Integrity on the
History element.

I hope this helps.
Cheers,

Markus
Re: Edapt issues when ecores extend one another [message #870842 is a reply to message #870840] Wed, 09 May 2012 20:46 Go to previous messageGo to next message
Dmitry Volchegursky is currently offline Dmitry VolchegurskyFriend
Messages: 2
Registered: March 2012
Junior Member
thanks Markus for the quick response. in use case 2 example ecore2 and ecore3 do not reference each other, but both of them reference ecore1. so in reality there are two final models ecore1<-ecore2 and ecore1<-ecore3. if i will have 1 history for all ecores will edapt know to migrate each model?

thanks,
Dmitry
Re: Edapt issues when ecores extend one another [message #870845 is a reply to message #870842] Wed, 09 May 2012 21:14 Go to previous messageGo to next message
Markus Herrmannsdoerfer is currently offline Markus HerrmannsdoerferFriend
Messages: 50
Registered: July 2009
Member
Am 09.05.2012 22:46, schrieb Dmitry Volchegursky:
> thanks Markus for the quick response. in use case 2 example ecore2 and
> ecore3 do not reference each other, but both of them reference ecore1.
> so in reality there are two final models ecore1<-ecore2 and
> ecore1<-ecore3. if i will have 1 history for all ecores will edapt know
> to migrate each model?
>
> thanks,
> Dmitry
Since ecore2 and ecore3 are independent of each other, you need to use
the Add Metamodel to History action in the context menu. If you have 1
history for all ecores, Edapt will then know how to migrate each model.
However, if you also have multiple models that reference each other, you
need to also migrate them together, since otherwise the references can
no longer be resolved, if some of the models are migrated and others are
not.

Cheers,

Markus
Re: Edapt issues when ecores extend one another [message #1038552 is a reply to message #870845] Thu, 11 April 2013 02:22 Go to previous message
Jim Foscue is currently offline Jim FoscueFriend
Messages: 15
Registered: June 2012
Junior Member
I'm trying to do use case #1 right now with a single history file. My ecore2 model extends model ecore1 and the history file with ecore2. I'm getting issues doing this. I either get the following exception or it migrates but with errors. I'm using Juno. Has anybody had any recent success doing this?

Thanks in advance!

Caused by: java.lang.NullPointerException
at org.eclipse.emf.edapt.history.reconstruction.EcoreReconstructorSwitchBase.add(EcoreReconstructorSwitchBase.java:50)
at org.eclipse.emf.edapt.history.reconstruction.EcoreReconstructorSwitchBase.create(EcoreReconstructorSwitchBase.java:97)
at org.eclipse.emf.edapt.migration.execution.MigrationReconstructor$MigrationReconstructorSwitch.caseCreate(MigrationReconstructor.java:379)
at org.eclipse.emf.edapt.history.util.HistorySwitch.doSwitch(HistorySwitch.java:175)
at org.eclipse.emf.edapt.history.util.HistorySwitch.doSwitch(HistorySwitch.java:99)
at org.eclipse.emf.edapt.history.util.HistorySwitch.doSwitch(HistorySwitch.java:87)
at org.eclipse.emf.edapt.migration.execution.MigrationReconstructor.startChange(MigrationReconstructor.java:209)
at org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.startChange(CompositeReconstructorBase.java:143)
at org.eclipse.emf.edapt.history.reconstruction.EcoreForwardReconstructor.startChange(EcoreForwardReconstructor.java:69)
at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:99)
at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:104)
at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:80)
at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
at org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
at org.eclipse.emf.edapt.migration.execution.Migrator.migrate(Migrator.java:238)
at org.eclipse.emf.edapt.migration.execution.Migrator.migrateAndSave(Migrator.java:162)
at MigrationTest$1.run(MigrationTest.java:70)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
Previous Topic:Using EMFStore Navigator with model that has been modified programmatically
Next Topic:[Resolve][Teneo] - Howto copy EMF model from one database to another one
Goto Forum:
  


Current Time: Thu Apr 25 13:01:28 GMT 2024

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

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

Back to the top