|
Re: Edapt ecore migration with XSD/XML [message #1497096 is a reply to message #1495777] |
Wed, 03 December 2014 14:38 |
Maximilian Koegel Messages: 253 Registered: July 2009 |
Senior Member |
|
|
Hi Dennis,
yes, this is a bit confusing, sorry ;).
By only moving the attribute it is unclear to Edapt how it should
migrate the values in attribute B. Edapt can tell you that if you run
the Check Integrity Action (see Screenshot).
You need to use a refactoring operation to make this work:
1. Open the operation browser view, see screenshot
2. Run the Extract Class Operation on the "Config" class to extract a
new class "NewClass" which is contained in a Reference "reference" in
"Config" and which will hold the "typeB" attribute, see Screenshot.
3. The history will then look similar to what you can see in the screenshot.
Now the history also passes the integrity check.
Hope this helps!
Cheers,
Maximilian
--
Maximilian Kögel
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Am 02.12.2014 15:10, schrieb Dennis Melzer:
> Hello,
>
> i have an existing xsd file with a xml instance. I generate an ecore by the xsd with the xsd model importer. The ecore Model contains 1 class (Config) with 2 String Attribute. Now i can read the exisiting xml with the generated ResourceFactoryImpl.
>
> After that i add the edapt history file, because i want to add a new class and move 1 of the existing attribute. I add a reference to the root class. And now i can't read the xml instance and nothing is migrated.
> What's wrong?
> I add the whole project with the example, you have to edit the path to the xml file:
>
> The error is:
>
>
> org.eclipse.emf.edapt.migration.MigrationException: org.eclipse.emf.edapt.internal.migration.DiagnosticException: Model inconsistent
> The 'validFeature' constraint is violated on 'Attribute "typeB" of Instance of type "Config"'
>
> at org.eclipse.emf.edapt.spi.migration.impl.ModelImpl.checkConformance(ModelImpl.java:451)
> at org.eclipse.emf.edapt.internal.migration.execution.MigrationReconstructor.checkConformance(MigrationReconstructor.java:172)
> at org.eclipse.emf.edapt.internal.migration.execution.MigrationReconstructor.checkConformanceIfMoreThan(MigrationReconstructor.java:165)
> at org.eclipse.emf.edapt.internal.migration.execution.MigrationReconstructor.endRelease(MigrationReconstructor.java:148)
> at org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
> at org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
> 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:244)
> at org.eclipse.emf.edapt.migration.execution.Migrator.migrateAndLoad(Migrator.java:196)
> at edapt_test.Activator.performMigration(Activator.java:108)
> at edapt_test.Activator.checkMigration(Activator.java:89)
> at edapt_test.Activator.start(Activator.java:59)
> at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
> at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
> at java.security.AccessController.doPrivileged(Native Method)
> at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
> at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
> at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
> at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
> at org.eclipse.osgi.container.Module.doStart(Module.java:571)
> at org.eclipse.osgi.container.Module.start(Module.java:439)
> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
> at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
> at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
> at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
> Caused by: org.eclipse.emf.edapt.internal.migration.DiagnosticException: Model inconsistent
> The 'validFeature' constraint is violated on 'Attribute "typeB" of Instance of type "Config"'
>
> ... 29 more
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03976 seconds