Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348842 - Cannot create Diagram from Package hierarchy
Summary: Cannot create Diagram from Package hierarchy
Status: RESOLVED WORKSFORME
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-09 04:23 EDT by Ed Willink CLA
Modified: 2015-06-26 15:27 EDT (History)
1 user (show)

See Also:


Attachments
Missing attachment (40.52 KB, text/plain)
2011-06-09 04:24 EDT, Ed Willink CLA
no flags Details
Workaround fix for your model (40.51 KB, application/xml)
2011-06-09 08:19 EDT, Yann Tanguy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2011-06-09 04:23:34 EDT
(RC3) The attached was originally a *.cmof file, but that didn't work at all so I saved it as *.uml.

It contains a hierarchy of packages. Creating either Class or Package diagrams gives a missing canvas.

Four error logs below:

org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
	at org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler.runAsTransaction(AbstractPapyrusGmfCreateDiagramCommandHandler.java:119)
	at org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler$1.doExecute(AbstractPapyrusGmfCreateDiagramCommandHandler.java:268)
	at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
	at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
	at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
	at org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler.createDiagram(AbstractPapyrusGmfCreateDiagramCommandHandler.java:271)
	at org.eclipse.papyrus.wizards.CreateModelWizard.initDiagrams(CreateModelWizard.java:440)
	at org.eclipse.papyrus.wizards.InitModelWizard.initDiagrams(InitModelWizard.java:192)
	at org.eclipse.papyrus.wizards.CreateModelWizard.initDiagramModel(CreateModelWizard.java:398)
	at org.eclipse.papyrus.wizards.CreateModelWizard.createAndOpenPapyrusModel(CreateModelWizard.java:179)

----------------

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.uml2.uml.internal.impl.PackageImpl@96e356 (name: OCL_Associations, visibility: <unset>)' is not legal. (platform:/resource/org.eclipse.ocl.examples.pivot/model/OCL.uml, 3, 97)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
	at org.eclipse.papyrus.wizards.pages.SelectRootElementPage.getResourceForFile(SelectRootElementPage.java:155)
	at org.eclipse.papyrus.wizards.pages.SelectRootElementPage.<init>(SelectRootElementPage.java:71)
	at org.eclipse.papyrus.wizards.InitModelWizard.createSelectRootElementPage(InitModelWizard.java:73)
	at org.eclipse.papyrus.wizards.InitModelWizard.init(InitModelWizard.java:55)

------------------

Plug-in 'org.eclipse.papyrus.diagram.common' contributed an invalid Menu Extension (Path: 'editMenu' is invalid): org.eclipse.papyrus.diagram.common.objectContribution.pastewithmodelaction

------------------

Plug-in 'org.eclipse.gmf.runtime.diagram.ui.providers' contributed an invalid Menu Extension (Path: 'editMenu' is invalid): org.eclipse.gmf.runtime.diagram.ui.actions.internal.DuplicateActionDelegate
Comment 1 Ed Willink CLA 2011-06-09 04:24:18 EDT
Created attachment 197670 [details]
Missing attachment
Comment 2 Yann Tanguy CLA 2011-06-09 08:19:35 EDT
Created attachment 197688 [details]
Workaround fix for your model
Comment 3 Yann Tanguy CLA 2011-06-09 08:25:38 EDT
I don't clearly understand why at this point, but it look like Papyrus is unable to create new diagram when the root is not a Profile or Model (see https://bugs.eclipse.org/bugs/attachment.cgi?id=197688)
Comment 4 Ed Willink CLA 2011-06-09 12:46:04 EDT
Attached doesn't work for me; the uml xmlns is undefined.

A similar trick changing the root Package to Model, offers the root as a choice when creating, but the canvas is still missing.
Comment 5 Yann Tanguy CLA 2011-06-10 09:21:04 EDT
(In reply to comment #4)
> Attached doesn't work for me; the uml xmlns is undefined.
> 
> A similar trick changing the root Package to Model, offers the root as a choice
> when creating, but the canvas is still missing.

In fact there is actually a problem of diagram creation when trying to create diagram from the wizard for an existing model (someone else log a similar bug#348847).
That said, it should not prevent Papyrus from opening, and once opened (even if the canvas is grayed out at this point) you should be able to create add diagrams (if the root is a "Model" not a "Package").

If you can see Papyrus ModelExplorer after opening try to open the view (Window / Show View / Other / Papyrus / Model Explorer or reset the Papyrus perspective), 
once you have the ModelExplorer visible you can select Package or Model and add diagram (with the toolbar or the "Create new diagram" contextual menu).
Note that if the root element is a Package in your model, "Create new diagram" context menu does not shows up... another bug...





348847
Comment 6 Sébastien Gérard CLA 2011-06-21 07:27:21 EDT
Hi Ed,

did the Yann solved your pb?

Cheers... Séb.
Comment 7 Yann Tanguy CLA 2011-06-21 07:45:26 EDT
(In reply to comment #6)
> Hi Ed,
> 
> did the Yann solved your pb?
> 
> Cheers... Séb.

I just proposed a workaround, no fix has been provided for the bug, AFAIK no one is currently working on it.
Comment 8 Ed Willink CLA 2011-06-21 12:25:42 EDT
(In reply to comment #6)
> did the Yann solved your pb?
With two outstanding bugs in the region of my problem I haven't looked much further. I'm hoping to get some company time for OMG spec progress soon, at which point I will be looking to pull diagrams out of Papyrus into a document, but not top of my priorityies at present. Chnaging to a MOdel at the root should not be a problem for me, so hopefully that might then work.
Comment 9 Ed Willink CLA 2011-08-22 11:00:31 EDT
(In reply to comment #8)
> (In reply to comment #6)
> > did the Yann solved your pb?
No. Yann just referred to a duplicate Bugzilla 348847. I too am now using a tiny Model rooted UML and it just doesn't work. This makes it impossible for me to use Papyrus for OMG specification definition work.

After a few tries the Model Explorer gradually dies; more and more fails to repaint. ("org.eclipse.swt.SWTException: Widget is disposed" but only SWT context.)
Comment 10 Camille Letavernier CLA 2013-02-28 13:44:46 EST
I've tried to reproduce the issue on the latest 0.10 version, and it works for me.

I've created a UML model with a root Package, then created a Papyrus model from it, and I was able to create all kinds of diagrams.
Comment 11 Ed Willink CLA 2013-02-28 13:57:24 EST
(In reply to comment #10)
> I've created a UML model with a root Package, then created a Papyrus model
> from it, and I was able to create all kinds of diagrams.

Great, but since Yann reproduced the problem, surely RESOLVED FIXED?