Community
Participate
Working Groups
Build Identifier: While using Graphiti I try to get incomingConversationLinks from Participant using eGet and I get a IllegalStateException. This happens because Graphiti adds TransactionChangeRecorder as one of the adapters that need notification and Bpmn2OppositeReferenceAdapter uses internally EObjectEList for returning opposite objects. If Bpmn2OppositeReferenceAdapter would use regular List instead of EObjectEList, this wouldn't happen. Is the EObjectEList necessary ? Exception I get: java.lang.IllegalStateException: Cannot modify resource set without a write transaction at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348) at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302) at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(TransactionChangeRecorder.java:284) at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:240) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380) at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:255) at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:310) at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307) at org.eclipse.bpmn2.util.Bpmn2OppositeReferenceAdapter.getOppositeList(Bpmn2OppositeReferenceAdapter.java:105) at org.eclipse.bpmn2.impl.ParticipantImpl.getIncomingConversationLinks(ParticipantImpl.java:144) at org.eclipse.bpmn2.impl.ParticipantImpl.eGet(ParticipantImpl.java:334) at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1021) at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1013) at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1008) Reproducible: Always
As I understand it, EMF (for example the generated editor) expects values of multi-valued features to implement InternalEList (see Javadoc of that interface). Thus, some list type provided by EMF is needed, but not necessarily a notifying one. I will look for a suitable replacement. One question remains however: the feature incomingConversationLinks is marked as derived + transient. Why does the transaction mechanism not allow modifications like the one happening here (on-the-fly creation of list), although they do not modify the resource set? Seem's odd to me, but nevermind - notification is not needed and moreover most likely not wanted here.
Fixed with commit e452f4a7f3b8be78047841ce4d101baa4a26d877 (return BasicInternalEList)
Awesome, works, thanks!