Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMFForms] FeaturePathDomainModelReferenceConverter.getSetting throws DatabindingFailedException(Is the thrown exception an issue?)
[EMFForms] FeaturePathDomainModelReferenceConverter.getSetting throws DatabindingFailedException [message #1740957] Sun, 21 August 2016 15:36 Go to next message
Jon Passki is currently offline Jon PasskiFriend
Messages: 31
Registered: November 2015
Member

I have three Ecore files, base.ecore, control.ecore, and application.ecore:

  • base.ecore has an interface (also tested as an abstract class) called Nameable with an EString attribute "name".
  • control.ecore references base.ecore. It has a class called ControlGroup that extends Nameable and an unrelated containment reference.
  • application.ecore references base.ecore and control.ecore. It contains a class called Application that has a containment reference for ControlGroup. Application also extends Nameable.

The following two view models are defined:
<file filePath="viewmodels/ControlGroup.view">
  <filter key="root" value="true"/>
</file>
<file filePath="viewmodels/ControlGroupTreeMasterDetail.view"/>

ControlGroup.view includes a control for the "name" attribute and the unrelated control for a containment reference. ControlGroupTreeMasterDetail.view, as its name implies, contains only a TreeMasterDetail control.

A run configuration launches the e3 demo application, where I'm able to add a new ECP project and add an application model element without any issues. When I add a ControlGroup, with the above view models declared as extension points, I receive the following exception:

org.eclipse.emfforms.spi.core.services.databinding.DatabindingFailedException: The resolved Object ControlGroup doesn't contain the feature name.
  at org.eclipse.emfforms.core.services.databinding.featurepath.FeaturePathDomainModelReferenceConverter.getSetting(FeaturePathDomainModelReferenceConverter.java:175)
  at org.eclipse.emfforms.internal.core.services.databinding.EMFFormsDatabindingImpl.getSetting(EMFFormsDatabindingImpl.java:249)
  at org.eclipse.emfforms.internal.core.services.mappingprovider.defaultheuristic.EMFFormsMappingProviderDefaultHeuristic.getMappingFor(EMFFormsMappingProviderDefaultHeuristic.java:76)
  at org.eclipse.emfforms.internal.core.services.mappingprovider.EMFFormsMappingProviderManagerImpl.getAllSettingsFor(EMFFormsMappingProviderManagerImpl.java:92)
  at org.eclipse.emfforms.internal.core.services.controlmapper.SettingToControlMapperImpl.updateControlMapping(SettingToControlMapperImpl.java:180)
  at org.eclipse.emfforms.internal.core.services.controlmapper.SettingToControlMapperImpl.checkAndUpdateSettingToControlMapping(SettingToControlMapperImpl.java:255)
  at org.eclipse.emfforms.internal.core.services.controlmapper.SettingToControlMapperImpl.vControlAdded(SettingToControlMapperImpl.java:239)
  at org.eclipse.emfforms.internal.core.services.controlmapper.SettingToControlMapperImpl$ModelChangeAddRemoveListenerImplementation.notifyAdd(SettingToControlMapperImpl.java:70)
  at org.eclipse.emf.ecp.view.internal.context.ViewModelContextImpl$ViewModelContentAdapter.addAdapter(ViewModelContextImpl.java:620)


The view model is otherwise displayed without any UI issues. I'm able to interact with the "name" element no problem.

If there isn't a defined view model for ControlGroup, the application doesn't throw the above exception. I also tried just ControlGroup.view (commenting out its "root" filter element and also the ControlGroupTreeMasterDetail.view element. I received a similar exception:

org.eclipse.emfforms.spi.core.services.databinding.DatabindingFailedException: The resolved Object ControlGroup doesn't contain the feature name.
  at org.eclipse.emfforms.core.services.databinding.featurepath.FeaturePathDomainModelReferenceConverter.getSetting(FeaturePathDomainModelReferenceConverter.java:175)
  at org.eclipse.emfforms.internal.core.services.databinding.EMFFormsDatabindingImpl.getSetting(EMFFormsDatabindingImpl.java:249)
  at org.eclipse.emfforms.internal.core.services.mappingprovider.defaultheuristic.EMFFormsMappingProviderDefaultHeuristic.getMappingFor(EMFFormsMappingProviderDefaultHeuristic.java:76)
  at org.eclipse.emfforms.internal.core.services.mappingprovider.EMFFormsMappingProviderManagerImpl.getAllSettingsFor(EMFFormsMappingProviderManagerImpl.java:92)
  at org.eclipse.emf.ecp.view.internal.validation.ValidationServiceImpl$ViewModelChangeListener.notifyAdd(ValidationServiceImpl.java:156)
  at org.eclipse.emf.ecp.view.internal.context.ViewModelContextImpl$ViewModelContentAdapter.addAdapter(ViewModelContextImpl.java:620)


Are the above exception expected? If so, what can I do to pacify them?
Re: [EMFForms] FeaturePathDomainModelReferenceConverter.getSetting throws DatabindingFailedException [message #1740959 is a reply to message #1740957] Sun, 21 August 2016 15:59 Go to previous messageGo to next message
Jon Passki is currently offline Jon PasskiFriend
Messages: 31
Registered: November 2015
Member

Forgot to add:
* All model edit plugins are included in the run configuration (via a feature that includes the models)
* The target platform is Neon with ECP 1.9, running on a Mac

Also, I noticed if I edit the ControlGroup.view, unlink the Domain Model Reference for the "name" attribute, link it by selecting FeaturePathDomainModelReference, click "Link Domain Model EFeature", and select "name" again, I see a warning: "The selected EStructuralFeature has no PropertyDescriptor"
Re: [EMFForms] FeaturePathDomainModelReferenceConverter.getSetting throws DatabindingFailedException [message #1740960 is a reply to message #1740959] Sun, 21 August 2016 16:33 Go to previous messageGo to next message
Jon Passki is currently offline Jon PasskiFriend
Messages: 31
Registered: November 2015
Member

OK, I lied; there are some UI issues. The ControlGroup "name" attribute is defined in the Control.genmodel as its Edit -> Label Feature. When I add a new ControlGroup model element and modify the "name" attribute, the label isn't updated. This only occurs for those model elements which have a custom view model. When I modify the "name" attribute in other model elements extending the same Nameable interface, and those model elements don't have a custom view, the displayed label is updated.

Is this a bug?
Re: [EMFForms] FeaturePathDomainModelReferenceConverter.getSetting throws DatabindingFailedException [message #1740991 is a reply to message #1740960] Mon, 22 August 2016 09:13 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 174
Registered: May 2015
Senior Member
Hi Jon,

I think the ViewModel is broken. A correct View Model should behave just like a generated one (no errors, and correct ui updates) .
I could imagine, that there is a bug in the View Model editor. Could you please create a bug and provide a minimal example containing the ecore files and the view model.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMFForms] FeaturePathDomainModelReferenceConverter.getSetting throws DatabindingFailedException [message #1741061 is a reply to message #1740991] Mon, 22 August 2016 15:10 Go to previous messageGo to next message
Jon Passki is currently offline Jon PasskiFriend
Messages: 31
Registered: November 2015
Member

Hi Eugen,

Thanks for the reply. If I can reproduce it I'll definitely create a bug. At the moment, I'm having difficulties reproducing it.

Perhaps related, I noticed the Ecore file uses relative paths for the eStructuralFeatures:eType attribute. For example, instead of specifying an EString attribute as so:
eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"
It specifies them as:
eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EString"


When viewing the Ecore with the default Sample Ecore Model Editor no issues are noted. When I expand the "Nameable" type and select its "name" attribute, the editor loads the Ecore.ecore resource:
platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString
I'm able to expand the Ecore.ecore resource in the editor and navigate to EString under the ecore nsprefix.

When viewing it with the ECP Ecode Editor, the EType for the "name" attribute on the "Nameable" interface shows as invalid: triangle warning sign on the attribute with a red box on the EType. Also, while it does show the same Ecore.ecore platform resource URI, the editor cannot expand it. That is, I cannot navigate to the EString type since there's no "ecore" prefix viewable under the resource URI.

Oddly, when I recreate the view models and use them in the e4 demo app for this small reproducer, I don't see the stack trace as noted in the initial comment. I can change the value in the "name" attribute and the label is correctly updated. I do still see the warning "The selected EStructuralFeature has no PropertyDescriptor" when manually creating the control for the "name" attribute. I'll keep on digging. If I'm able to create a reproducer, I'll post back here with the bug.
Re: [EMFForms] FeaturePathDomainModelReferenceConverter.getSetting throws DatabindingFailedException [message #1741071 is a reply to message #1741061] Mon, 22 August 2016 16:38 Go to previous message
Jon Passki is currently offline Jon PasskiFriend
Messages: 31
Registered: November 2015
Member

Looking at my original workspace, I think I had a transient error of some sorts. The malfunctioning view model had a relative path for its domainModelEFeature:href attribute:
"../../com.example.base/model/base.ecore#//Nameable/name"


Subsequently created view models weren't relative:
"com.example.base#//Nameable/name"


The latter view model showed the Domain Model Reference of Nameable -> name : EString. I can delete and re-generate the "name" control without any observed issues. At this point, it works for me, so no bug report. If that changes, I'll update accordingly.




Previous Topic:[EMFForms] ClassCastException while setting Validation Color after upgrading to EMFForms 1.9
Next Topic:EMF Forms UI
Goto Forum:
  


Current Time: Fri Apr 26 09:43:29 GMT 2024

Powered by FUDForum. Page generated in 0.03320 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top