Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Delete Parent Container shape if Child Shapes are deleted
Delete Parent Container shape if Child Shapes are deleted [message #1682169] Tue, 17 March 2015 16:22 Go to next message
Abhishek Chakraborty is currently offline Abhishek ChakrabortyFriend
Messages: 77
Registered: July 2009
Location: Cologne, Germany

I have this feature requirement where I am trying to delete the parent container ,when child Shape is deleted. But I am getting this error even though I have used
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(containerObject);
editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
protected void doExecute() {

to execute my code

I am trying to call the deleteFeature for the parent containerShape from the moveShape() of the Child.

!ENTRY org.eclipse.graphiti.ui 4 0 2015-03-17 17:11:53.604
!MESSAGE GFCommandStack.execute(Command) java.lang.IllegalStateException: Cannot modify resource set without a write transaction
java.lang.IllegalStateException: Cannot modify resource set without a write transaction
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(
at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(
at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(
at org.eclipse.emf.ecore.util.EcoreUtil.remove(
at org.eclipse.emf.ecore.util.EcoreUtil.delete(
at org.eclipse.graphiti.features.impl.DefaultRemoveFeature.remove(
at org.eclipse.graphiti.pattern.AbstractPattern.remove(
at org.eclipse.graphiti.pattern.RemoveFeatureForPattern.remove(
at org.eclipse.graphiti.ui.features.DefaultDeleteFeature.delete(
at org.eclipse.graphiti.pattern.AbstractPattern.delete(
at com.silexica.mapping.editor.pattern.SchedulerPattern.delete(
at org.eclipse.graphiti.pattern.DeleteFeatureForPattern.delete(
at com.silexica.mapping.editor.pattern.ProcessorPattern$
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(
at com.silexica.mapping.editor.pattern.ProcessorPattern.postMoveShape(
at org.eclipse.graphiti.pattern.AbstractPattern.moveShape(
at com.silexica.mapping.editor.pattern.ProcessorPattern.moveShape(
at org.eclipse.graphiti.pattern.MoveShapeFeatureForPattern.moveShape(
at org.eclipse.graphiti.internal.command.MoveShapeFeatureCommandWithContext.execute(

Abhishek Chakraborty
Re: Delete Parent Container shape if Child Shapes are deleted [message #1683924 is a reply to message #1682169] Wed, 18 March 2015 08:02 Go to previous message
Krisztian Koncz is currently offline Krisztian KonczFriend
Messages: 31
Registered: September 2014
Location: Budapest

I'm not sure, but i think you try to execute this command in another command. (Features are wrapped in commands). Have you tried in the DeleteFeature's postDelete hook?

[Updated on: Wed, 18 March 2015 09:00]

Report message to a moderator

Previous Topic:Disable a connection
Next Topic:org.eclipse.graphiti.ui refactoring
Goto Forum:

Current Time: Mon Dec 16 13:20:39 GMT 2019

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

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

Back to the top