Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [SOLVED] Adding specific nodes from palette
[SOLVED] Adding specific nodes from palette [message #1786908] Tue, 15 May 2018 11:39 Go to next message
Sergio García is currently offline Sergio GarcíaFriend
Messages: 15
Registered: May 2018
Junior Member
Hi,

I'm a rookie with Sirius, so maybe my question is a bit stupid (I also tried to find an answer to it in the already stated questions but I couldn't). I created a palette section and some of the nodes in this palette can be dragged and dropped into the diagram, but others not. I suspect it is related to the Reference name in the instance of the node creation item.

The Node creation items that work are directly connected to the main class of my ecore (Mission) by the feature operator. However, the second group of items that inherit from the Pattern abstract class don't. Anyway, the error that I get when I try to add a new node (let's say, createVisit) is the following:

Message: execute

Exception Stack Trace: org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:496)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:71)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:52)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.handleDrop(AbstractTransferDropTargetListener.java:339)
at org.eclipse.gef.dnd.TemplateTransferDropTargetListener.handleDrop(TemplateTransferDropTargetListener.java:115)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.SiriusPaletteToolDropTargetListener.handleDrop(SiriusPaletteToolDropTargetListener.java:117)
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.lambda$0(JFaceUtil.java:44)
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:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4258)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1510)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1314)
at org.eclipse.swt.dnd.DropTarget.drop(DropTarget.java:723)
at org.eclipse.swt.dnd.DropTarget.performDragOperation(DropTarget.java:737)
at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:451)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSView.dragImage(NSView.java:159)
at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:394)
at org.eclipse.swt.dnd.DragSource.lambda$0(DragSource.java:219)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4258)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1510)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1314)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4082)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3699)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
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:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Caused by: java.lang.ArrayStoreException

Thank you in advance,
Sergio

PS: I'm uploading the ecore and odesign files, if you require anything else just ask me.

[Updated on: Mon, 17 September 2018 13:22]

Report message to a moderator

Re: Adding specific nodes from palette [message #1787015 is a reply to message #1786908] Thu, 17 May 2018 11:01 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 388
Registered: May 2011
Senior Member
Hello,

In the CreateInstance of your tool, the reference name field is the reference that will contain the new element. For your "Operator" elements it works as the Mission class has a contaiment reference "operator" typed Operator. But this reference can't contain a Pattern element, however your tool is set on the same "operator" reference. Which contaiment reference in your metamodel should contain Patterns element? This is the reference that should be used in your tool.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Adding specific nodes from palette [message #1787020 is a reply to message #1787015] Thu, 17 May 2018 11:50 Go to previous messageGo to next message
Sergio García is currently offline Sergio GarcíaFriend
Messages: 15
Registered: May 2018
Junior Member
Thank you for your answer.

I guess that that reference should be "pattern", but I don't know how to reference it. Should I change the context? If so, how do I do it?
Re: Adding specific nodes from palette [message #1787024 is a reply to message #1787020] Thu, 17 May 2018 12:13 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 388
Registered: May 2011
Senior Member
There is no "pattern" reference in your Mission EClass. I found one in DelegateOp though. Either it is missing in your metamodel, or the mappings in your odesign is wrong and VisitNode should be a border node of a DelegateOpNode (or DelegateOpNode should be a container mapping). By the way, you have not set the semanticCandidateExpression of your mappings, it's a good practice (improve performances etc) and it will help you understanding the structure of the element you are representing on your diagram.

Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Adding specific nodes from palette [message #1787035 is a reply to message #1787024] Thu, 17 May 2018 13:35 Go to previous messageGo to next message
Sergio García is currently offline Sergio GarcíaFriend
Messages: 15
Registered: May 2018
Junior Member
I implemented VisitNode as a border node of DelegateOpNode. Then, under the Palette section, I created a new node creation whose reference name is pattern. However, I still cannot add a new Visit node, this time without any kind of errors or alarms from eclipse.

Please, see pictures attached.
Re: Adding specific nodes from palette [message #1787039 is a reply to message #1787035] Thu, 17 May 2018 14:40 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 388
Registered: May 2011
Senior Member
In VisiteNode mapping, have you set the semantic candidate expression field to "feature:pattern"? The screenshot is cut just before displaying this field.

Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Adding specific nodes from palette [message #1787072 is a reply to message #1787039] Fri, 18 May 2018 11:35 Go to previous messageGo to next message
Sergio García is currently offline Sergio GarcíaFriend
Messages: 15
Registered: May 2018
Junior Member
Yes, it is. I'm attaching the odesing file to illustrate it.
Re: Adding specific nodes from palette [message #1787180 is a reply to message #1787072] Mon, 21 May 2018 11:31 Go to previous messageGo to next message
Sergio García is currently offline Sergio GarcíaFriend
Messages: 15
Registered: May 2018
Junior Member
Sorry for being a bit insistent, but do you know what the problem is?
Re: Adding specific nodes from palette [message #1787308 is a reply to message #1787180] Wed, 23 May 2018 13:31 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 388
Registered: May 2011
Senior Member
Hello,

The border node mapping VisitNode has no style, you probably forgot it when you moved the mapping.
By the way, I recommand:
- to fill the semantic candidates expressions of the other mappings, for instance for DelegateOpNode, it should be "feature:operator" (you should probably name it operators in your metamodel as it is multi-valued). If this field is not filled then Sirius will look for candidate anywhere in the current project, so you can have unexpected result, like showing an element from a different model of the project. Furthermore, it is far better in performance.
- to define mapping on abstract metaclasses when possible. It looks like some of your mappings are identical for domain classes with a common super class, like StrictOrderedVisitNode, SequenceVisitNode, PattrolingNode etc). You can define a single mapping on "MouvementPattern" or even "Pattern". If you need different display depending on the kind of "Pattern" subclass it is, you can define conditional style. It will be easier to manage your diagram description, create tools etc this way.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Adding specific nodes from palette [message #1795162 is a reply to message #1787308] Mon, 17 September 2018 13:22 Go to previous message
Sergio García is currently offline Sergio GarcíaFriend
Messages: 15
Registered: May 2018
Junior Member
Thanks, now it's solved!
Previous Topic:[ANN] Obeo Designer CE 11.0 available, powered by Sirius 6.0
Next Topic:Problem in creating edge when classes in different packages in sirius
Goto Forum:
  


Current Time: Thu Nov 15 16:34:15 GMT 2018

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

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

Back to the top