| Summary: | Register Metamodel does not work properly on inheriting metamodels | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] MMT.ATL | Reporter: | Vincent MAHE <vmahe> | ||||||
| Component: | UI | Assignee: | mmt-atl.toolkit-inbox <mmt-atl.toolkit-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | dwagelaar, william.piers | ||||||
| Version: | unspecified | Flags: | william.piers:
iplog+
|
||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 177522 [details]
Patch to solve the problem
The way to load the resource corresponding to the Ecore file was not the appropriate one.
The joined patch makes inherited metamodels linked to the registered one.
It also adds registering of sub-packages.
Rem: the current way considers only workspace files so it may rise issues when used standalone.
Hello, I tested the patch but it seems that the subpackages registration isn't necessary:
for (EPackage subPackage : p.getESubpackages()) {
registerPackage(subPackage);
}
The getElementsByType already returns all packages & subpackages, so with your patch, subpackages are registered twice.
Did you encounter a special case which made you make this choice, or do you think we can remove this loop ?
Thanks in advance
I applied the patch on HEAD without the lines I mentioned. Please reopen the bug if necessary. This was released for ATL 3.2 - closing. |
Created attachment 174733 [details] a test project with the presented failure For a metamodel which relies on another metamodel (ie extends AM3 metamodel), the "Register Metamodel" is not able to rely the inheriting NsURI with the NsURI of inherited metamodel (despite this one has been registered opening AM3 Megamodel Navigator). A sample is joined for test.