Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Problems with custom Activity Diagram
Problems with custom Activity Diagram [message #1747609] Wed, 16 November 2016 12:43 Go to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
I'm trying to create my own tooling with a custom ActivityDiagram but can't get it to work.

In the attached project I have a very simple tooling with a Viewpoint configuration defining custom diagram along with a palette with one tool for Initial Node.

When dragging and dropping the my initial node on top of my activity diagram I get the following exception. However when dropping from the standard palette/tool it works.

When comparing my configuration from the one in org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.configuration I can't see any problem but obviously I'm missing something. Can anyone point it out?


!ENTRY org.eclipse.jface 4 2 2016-11-16 13:34:25.009
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy.getCreateCommand(DefaultSemanticEditPolicy.java:153)
	at org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy.getSemanticCommandSwitch(DefaultSemanticEditPolicy.java:118)
	at org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy.getSemanticCommand(DefaultSemanticEditPolicy.java:78)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy.getCommand(SemanticEditPolicy.java:69)
	at org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy.getCommand(DefaultSemanticEditPolicy.java:72)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:502)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$1(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$1.run(GraphicalEditPart.java:482)
	at org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain.runExclusive(PapyrusROTransactionalEditingDomain.java:271)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.getCommand(GraphicalEditPart.java:477)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy.getCreateElementAndViewCommand(CreationEditPolicy.java:340)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy.getCommand(CreationEditPolicy.java:87)
	at org.eclipse.papyrus.infra.gmfdiag.dnd.policy.CustomizableDropEditPolicy.getCommand(CustomizableDropEditPolicy.java:118)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:502)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$1(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$1.run(GraphicalEditPart.java:482)
	at org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain.runExclusive(PapyrusROTransactionalEditingDomain.java:271)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.getCommand(GraphicalEditPart.java:477)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy.getUnspecifiedTypeCreateCommand(CreationEditPolicy.java:395)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy.getCommand(CreationEditPolicy.java:85)
	at org.eclipse.papyrus.infra.gmfdiag.dnd.policy.CustomizableDropEditPolicy.getCommand(CustomizableDropEditPolicy.java:118)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:502)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$1(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$1.run(GraphicalEditPart.java:482)
	at org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain.runExclusive(PapyrusROTransactionalEditingDomain.java:271)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.getCommand(GraphicalEditPart.java:477)
	at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.getCommand(AbstractTransferDropTargetListener.java:215)
	at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.handleDrop(AbstractTransferDropTargetListener.java:337)
	at org.eclipse.gef.dnd.TemplateTransferDropTargetListener.handleDrop(TemplateTransferDropTargetListener.java:115)
	at org.eclipse.gmf.runtime.diagram.ui.internal.parts.PaletteToolTransferDropTargetListener.handleDrop(PaletteToolTransferDropTargetListener.java:89)
	at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.drop(AbstractTransferDropTargetListener.java:183)
	at org.eclipse.jface.util.DelegatingDropAdapter$3.run(DelegatingDropAdapter.java:219)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
	at org.eclipse.jface.util.DelegatingDropAdapter.drop(DelegatingDropAdapter.java:216)
	at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:91)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5219)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1340)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1366)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1349)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1134)
	at org.eclipse.swt.dnd.DropTarget.drag_data_received(DropTarget.java:377)
	at org.eclipse.swt.dnd.DropTarget.Drag_Data_Received(DropTarget.java:254)
	at org.eclipse.swt.internal.gtk.OS._gtk_drag_get_data(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_drag_get_data(OS.java:7642)
	at org.eclipse.swt.dnd.DropTarget.drag_drop(DropTarget.java:422)
	at org.eclipse.swt.dnd.DropTarget.Drag_Drop(DropTarget.java:261)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:9555)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1275)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2495)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4141)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Re: Problems with custom Activity Diagram [message #1747613 is a reply to message #1747609] Wed, 16 November 2016 13:29 Go to previous messageGo to next message
Benoit Maggi is currently offline Benoit MaggiFriend
Messages: 129
Registered: March 2013
Location: Bordeaux, France
Senior Member
Hi Patrcik,

Your palette is using an unknown elementype.
Replacing
<elementDescriptors elementTypeId="my.MyActivityDiagram.MyActivityPaletteToolDefinition.InitialNode.InitialNode_Shape"/>
by
<elementDescriptors elementTypeId="my.MyActivityDiagram.InitialNode.InitialNode_Shape"/>
should do the trick.

Regards,
Benoit

Ps : you may find inspiration in [1] to add unit tests and avoid similar problem

1 : https://git.eclipse.org/c/papyrus/org.eclipse.papyrus-sysml.git/tree/gui/org.eclipse.papyrus.sysml14.ui.tests/test/org/eclipse/papyrus/sysml14/ui/tests/palette/AbstractPaletteTest.java
Re: Problems with custom Activity Diagram [message #1747615 is a reply to message #1747613] Wed, 16 November 2016 13:43 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Thanks for a very quick response!
Re: Problems with custom Activity Diagram [message #1755766 is a reply to message #1747615] Tue, 07 March 2017 17:56 Go to previous messageGo to next message
Athanasios Zolotas is currently offline Athanasios ZolotasFriend
Messages: 52
Registered: November 2016
Location: York
Member
Hi,

I get the same exception. I triple checked my elementTypeIds and they are identical. I attach a minimal version of my project.
I also have another problem that might be related: when I click an item on my palette and move the cursor on the canvas I got the red prohibiition symbol. I believe that this means that this element cannot be applied on this diagram. However, I don't have any such restriction (I believe).

Any ideas?
Re: Problems with custom Activity Diagram [message #1755805 is a reply to message #1755766] Wed, 08 March 2017 10:30 Go to previous messageGo to next message
Benoit Maggi is currently offline Benoit MaggiFriend
Messages: 129
Registered: March 2013
Location: Bordeaux, France
Senior Member
Hi Athanasios,

Please open a new topic when you have a question.

I briefly checked your code and:
- your are using the same ids for your elementtypeset
- the viewpoint is missing an icon
- an icon is badly defined in your elementype set

Regards,
Benoit
Re: Problems with custom Activity Diagram [message #1755810 is a reply to message #1755805] Wed, 08 March 2017 11:01 Go to previous messageGo to next message
Athanasios Zolotas is currently offline Athanasios ZolotasFriend
Messages: 52
Registered: November 2016
Location: York
Member
Hi Benoit,

Thanks for your reply.

Regarding the problems that you mentioned:
Quote:
- your are using the same ids for your elementtypeset

I realised the identifier problem which I changed but no luck. The same problem exists.

Quote:
- the viewpoint is missing an icon


I added an icon but the problem still exists. Are icons mandatory?

Quote:
- an icon is badly defined in your elementype set


I am not sure which icon you're refering to but I replaced all the icons with some that I found in a plugin that works fine, just to make sure that this is not the problem and unfortunately I get the same exception.

I get these messages now:
http://i63.tinypic.com/16acqih.png

Quote:
Please open a new topic when you have a question.


PS.: I apologise for that. I thought that it is not best practice to start a new thread on a topic that is already discussed as I believed that the error I received was related to what the OP posted. I am happy for the moderators to move our discussion in a new post.

[Updated on: Wed, 08 March 2017 11:29]

Report message to a moderator

Re: Problems with custom Activity Diagram [message #1755823 is a reply to message #1755810] Wed, 08 March 2017 12:52 Go to previous message
Athanasios Zolotas is currently offline Athanasios ZolotasFriend
Messages: 52
Registered: November 2016
Location: York
Member
Apparantly, the problem was that I had the org.eclipse.papyrus.umldi.Class as specializedTypesId in my .typesconfigurations file instead of the org.eclipse.papyrus.uml.Class

Previous Topic:Papyrus Internationalization -> new video available
Next Topic:Associations intersections
Goto Forum:
  


Current Time: Fri Apr 19 21:06:22 GMT 2024

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

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

Back to the top