Community
Participate
Working Groups
Build Identifier: 20100917-0705 It is able to add new metamodels to a MetamodelRegistry using its "merge" operation. But it is impossible to update an existing one (same nsURI). Delete (in the merge operation) the test "if(!this.myMetamodelDescs.containsKey(id))" solve this issue. Reproducible: Always Steps to Reproduce: 1. Update an already registered metamodel (dynamic instance) 2. Re-register this metamodel in EMf registry : EPackage.Registry.INSTANCE.put(rootPa.getNsURI(), rootPa); 3. Merge the Emf registry with the QVT MetamodelRegistry : MetamodelRegistry current = new MetamodelRegistry (new EmfStandaloneMetamodelProvider()); MetamodelRegistry.getInstance().merge(current); 4. The updated metamodel version do not replace the old one
(In reply to Alexis Muller from comment #0) > Delete (in the merge operation) the test > "if(!this.myMetamodelDescs.containsKey(id))" solve this issue. Since existing keys stem from a metamodel provider with a higher priority, deleting the above code is certainly not an option. > 3. Merge the Emf registry with the QVT MetamodelRegistry : > MetamodelRegistry current = new MetamodelRegistry > (new EmfStandaloneMetamodelProvider()); > MetamodelRegistry.getInstance().merge(current); You are dealing with MetamodelRegistry as an internal class here. In contrast, my approach for bug 441094 aims at preserving the EPackage.Registry passed to the TransformationExcecutor. Thus, you could just put your new package into the package registry you are using, and it automatically becomes visible to the internal MetamodelRegistry.
Succeeding test case pushed to cgerking. Commit ID: 95268f0f9ef8d52c00bcc89bf244e7cfe9ecfd1c
(In reply to Christopher Gerking from comment #2) > Succeeding test case pushed to cgerking. > > Commit ID: 95268f0f9ef8d52c00bcc89bf244e7cfe9ecfd1c Cherry-picked to master for M4. Commit id: de499dbfbd960a63f62c4938d9dc71172e075120