Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EObject does not send Notification.SET
EObject does not send Notification.SET [message #1770485] Sat, 12 August 2017 13:47 Go to next message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 124
Registered: July 2009
Senior Member

I have implemented a custom value object where the content of a Value EObject will be wrapped into a CDATA element. My class extends the MinimalEObjectImpl.Container.

It works fine. But my problem is, that my object did not send any Notifications if the value changed.
So as a result my other classes (Part of Eclipse BPMN2) will not receive a Notification.SET event if the value is changed. So I guess I have missed something in my implementation. I am not too familiar with EMF so I can't see where the problem is located.
Did I need to register my class for notifications?

The Code of the setValue() method looks like this:
	public void setValue(String newValue) {
		// do not allow null values!
		if (newValue==null) {

		FeatureMap.Entry cdata = null;

		// try to get the container Item EObject to determine the type
		Item item = (Item) this.eContainer;
		if (item != null && "xs:boolean".equals(item.getType())) {
			cdata = FeatureMapUtil.createTextEntry(newValue);
		} else {
			// default will wrap the value into a CDATA entry
			cdata = FeatureMapUtil.createCDATAEntry(newValue);
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
		case ModelPackage.VALUE__MIXED:
			((FeatureMap.Internal) getMixed()).set(newValue);
		case ModelPackage.VALUE__VALUE:
			setValue((String) newValue);
		super.eSet(featureID, newValue);

The complete class can be seen here:

Thanks for any help in advance.

Re: EObject does not send Notification.SET [message #1770491 is a reply to message #1770485] Sat, 12 August 2017 16:37 Go to previous message
Ralph Soika is currently offline Ralph SoikaFriend
Messages: 124
Registered: July 2009
Senior Member
It looks like the problem was my Adapter Class. I extended my Adapter from 'org.eclipse.emf.common.notify.impl.AdapterImpl'
After I changed this base class to 'org.eclipse.emf.ecore.util.EContentAdapter' all notifications about changes in my model occur! :-)
Previous Topic:EAnnotation usage in ecore
Next Topic:Derived unions and subsetted properties in UML to Ecore converter
Goto Forum:

Current Time: Sun Mar 18 02:28:37 GMT 2018

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

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