[Edapt] A question about custom migration [message #1460547] |
Mon, 03 November 2014 17:32 |
|
Hi,
As far as I have understood the method :
public void migrateBefore(Model model, Metamodel metamodel) throws MigrationException {
// Put your code here before migration
}
It should receive the metamodel before modification has been applied. Right ?
What could be the reason why I currently receive the expected metamodel and not the initial ? Is it a problem of URI in historic ? Should the 'Custom Migration' be at the beginning of the release ?
I have also a model which refer to the new meta model too... While no migration has been done... Strange behavior....
|
|
|
|
Re: [Edapt] A question about custom migration [message #1461129 is a reply to message #1460552] |
Tue, 04 November 2014 08:28 |
|
It seems to be a problem with the CustomMigration. Javadoc says that CustomeMigration::migrateBefore is called before metamodel is changed, and migrateAfter after metamodel is changed.
BUT If we put a CustomMigration at the beginning of a release, the metamodel is not changed in the both Methods ! For the method migrateBefore this is ok, but not for migrateAfter !
If we put it a the end of the release, the metamodel received in both method is the metamodel changed !
Is there a specific usage I missed ? I work with the latest release (1.0.0.201410271332).
|
|
|
Re: [Edapt] A question about custom migration [message #1463426 is a reply to message #1461129] |
Thu, 06 November 2014 14:51 |
Maximilian Koegel Messages: 253 Registered: July 2009 |
Senior Member |
|
|
Hi,
before and after in this case refers to before and after the change
operation the custom migration is attached to, NOT the full migration of
the release. This seems to be ambiguous in the JavaDoc, could you please
open a Bugzilla if you think so. Thanks!
Cheers,
Maximilian
Am 04.11.2014 09:28, schrieb Olivier Prouvost:
>
> It seems to be a problem with the CustomMigration. Javadoc says that
> CustomeMigration::migrateBefore is called before metamodel is changed,
> and migrateAfter after metamodel is changed.
> BUT If we put a CustomMigration at the beginning of a release, the
> metamodel is not changed in the both Methods ! For the method
> migrateBefore this is ok, but not for migrateAfter !
> If we put it a the end of the release, the metamodel received in both
> method is the metamodel changed !
> Is there a specific usage I missed ? I work with the latest release
> (1.0.0.201410271332).
>
>
--
Maximilian Kögel
Get Professional Eclipse Support: http://eclipsesource.com/munich
|
|
|
Re: [Edapt] A question about custom migration [message #1463750 is a reply to message #1463426] |
Thu, 06 November 2014 22:19 |
|
Ok.
So in my attached sample (customeMigration.png), my Custom Migration will always receive the same metamodel in the before and after method, because it stands at the end of my release ?
It would mean that if we want to store the data in the model before migration, we must have a custom migration at the beginning of the release to remember of the values, and another customMigration at the end of the release to transfer the information ?
Right ?
|
|
|
|
Powered by
FUDForum. Page generated in 0.02895 seconds