Skip to main content

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: 161
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: 161
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: Fri Mar 05 14:45:25 GMT 2021

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

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

Back to the top