Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Problem in creating sirius diagram (java.lang.IllegalStateException: Cannot modify resource set without a write transaction)
Problem in creating sirius diagram [message #1435330] Wed, 01 October 2014 10:37 Go to next message
pragati shinde is currently offline pragati shindeFriend
Messages: 2
Registered: September 2014
Junior Member
Hi ,

I am trying to create sirius diagram programmatically , but the following two lines are throwing java.lang.IllegalStateException exception :

RepresentationDescription repDesc = representationDescriptionInEditingDomain;
testRep = DialectManager.INSTANCE.createRepresentation(name, obj, repDesc , session, new NullProgressMonitor());


Exception :
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:374)
at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:294)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:303)
at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionServicesImpl.addRepresentationToContainer(DAnalysisSessionServicesImpl.java:354)
at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionServicesImpl.putCustomData(DAnalysisSessionServicesImpl.java:285)
at org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectServices.createRepresentation(DiagramDialectServices.java:170)
at org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.createRepresentation(DialectManagerImpl.java:140)
at com.cognizant.codefactory.Sirius.SiriusDia_Generator.createDiagram(SiriusDia_Generator.java:194)
at com.cognizant.codefactory.Sirius.SiriusDia_Generator.createSiriusDiagram(SiriusDia_Generator.java:136)
at com.cognizant.codefactory.Sirius.SiriusDia_Generator.execute(SiriusDia_Generator.java:65)
at com.cognizant.codefactory.itdp_db.GenerateNavigationFile.generateNavigation(GenerateNavigationFile.java:64)
at com.cognizant.codefactory.itdp_db.ProcessDBData.fecthTCfromDB(ProcessDBData.java:54)
at com.cognizant.codefactory.svn.DownloadModelScript.GenerateModelImage(DownloadModelScript.java:87)
at com.cognizant.codefactory.jobhandler.StartUploading$1.run(StartUploading.java:33)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Re: Problem in creating sirius diagram [message #1435421 is a reply to message #1435330] Wed, 01 October 2014 13:05 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
The Sirius editing domain is transactional, so you need to do that in a
command. EMF Transaction has quite good documentation in the Eclipse Help.

Felix

On 01/10/2014 14:43, pragati shinde wrote:
> Hi ,
>
> I am trying to create sirius diagram programmatically , but the
> following two lines are throwing java.lang.IllegalStateException
> exception :
>
> RepresentationDescription repDesc =
> representationDescriptionInEditingDomain;
> testRep =
> DialectManager.INSTANCE.createRepresentation(name, obj, repDesc ,
> session, new NullProgressMonitor());
>
>
> Exception :
> 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:374)
>
> at
> org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249)
>
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:294)
>
> at
> org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:303)
> at
> org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionServicesImpl.addRepresentationToContainer(DAnalysisSessionServicesImpl.java:354)
>
> at
> org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionServicesImpl.putCustomData(DAnalysisSessionServicesImpl.java:285)
>
> at
> org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectServices.createRepresentation(DiagramDialectServices.java:170)
>
> at
> org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.createRepresentation(DialectManagerImpl.java:140)
>
> at
> com.cognizant.codefactory.Sirius.SiriusDia_Generator.createDiagram(SiriusDia_Generator.java:194)
>
> at
> com.cognizant.codefactory.Sirius.SiriusDia_Generator.createSiriusDiagram(SiriusDia_Generator.java:136)
>
> at
> com.cognizant.codefactory.Sirius.SiriusDia_Generator.execute(SiriusDia_Generator.java:65)
>
> at
> com.cognizant.codefactory.itdp_db.GenerateNavigationFile.generateNavigation(GenerateNavigationFile.java:64)
>
> at
> com.cognizant.codefactory.itdp_db.ProcessDBData.fecthTCfromDB(ProcessDBData.java:54)
>
> at
> com.cognizant.codefactory.svn.DownloadModelScript.GenerateModelImage(DownloadModelScript.java:87)
>
> at
> com.cognizant.codefactory.jobhandler.StartUploading$1.run(StartUploading.java:33)
>
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
>
>
Previous Topic:Remove palette view
Next Topic:API documentation
Goto Forum:
  


Current Time: Tue Apr 07 16:07:13 GMT 2020

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

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

Back to the top