Community
Participate
Working Groups
If you have an Ecore where you have a package and directly inside it a subpackage without an EClassifier next to the subpackage, then the view model for Classes of this subpackage is not loaded. The problem is, that EMF doesn't generate any package description for the parent package. But the ViewModel expects this parent package to exists. This way the uri of the rootEClass cannot be resolved and the ECLass of the ViewModel doesn't fit the provided EClass when retrieving the view. We need to handle this case in the EcoreHelper class.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
@Eugen, many thanks for your comment, it was so helpful to find the workaround! This bug is still actual and it blocks the EMF Forms usage for the good part of .ecore with subpackages. For the .ecore like: <?xml version="1.0" encoding="UTF-8"?> <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="emfforms" nsURI="http://www.example.org/emfforms" nsPrefix="emfforms"> <eSubpackages name="subpackage" nsURI="http://www.example.org/emfforms/subpackage/1.0.0" nsPrefix="subpackage"> <eClassifiers xsi:type="ecore:EClass" name="Subtype"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> </eClassifiers> </eSubpackages> </ecore:EPackage> The .view is saved with hrefs like <?xml version="1.0" encoding="ASCII"?> <org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model/1170" xmi:id="_R3wuUBfeEemBw6aVb088JQ" name="Subtype"> <rootEClass href="http://www.example.org/emfforms#//subpackage/Subtype"/> <children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_R5P8EBfeEemBw6aVb088JQ" name="Control name"> <domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_R5P8ERfeEemBw6aVb088JQ"> <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.example.org/emfforms#//subpackage/Subtype/name"/> </domainModelReference> </children> <ecorePaths>/org.example.ecore/model/subpackages.ecore</ecorePaths> </org.eclipse.emf.ecp.view.model:View> And then ViewModelFileExtensionsManager is unable to resolve view.getRootEClass() to EClass instance
@Alexander Yes it is still a valid issue. The main reason nobody worked on this issue is, that subpackages are not well supported in many tools based on EMF. Maximilian lists the use of subpackages as one of the 5 don't when using EMF https://eclipsesource.com/blogs/2013/03/19/emf-dos-and-donts-5/ Nonetheless we would love to have a fix for this. Any help is appreciated.
This issue has been migrated to https://api.github.com/eclipse-ecp/issues/org.eclipse.emf.ecp.core.