several mappings for single ecore class [message #539966] |
Mon, 14 June 2010 09:04  |
Eclipse User |
|
|
|
Hello guys,
I have been looking for several hours now for a solution for this problem.
Here it is, shortly:
I need to generate something like:
....
....
<task>
<pre>
<script> .... </script>
</pre>
<post>
<script> ... </script>
<post>
<task>
...
...
So I will need 2 tools to create "script" elements: one to create "pre" script, and another to create "post" script.
I defined to figures and 2 creation tools.
In my *.gmfmap file, I wrote 2 Node Mappings for my ecore type "script":
one mapping for task.pre:Script
one mapping for task.post:Script
Here's a piece of the *.gmfmap file:
<ownedChild>
<domainMetaElement
href="SchedDev.ecore#//TaskType"/>
<tool
xsi:type="gmftool:CreationTool"
href="SchedDev.gmftool#//@palette/@tools.0/@tools.2"/>
<diagramNode
href="SchedDev.gmfgraph#TaskType"/>
<children>
<containmentFeature
href="SchedDev.ecore#//TaskType/pre"/>
<ownedChild>
<domainMetaElement
href="SchedDev.ecore#//Script"/>
<tool
xsi:type="gmftool:CreationTool"
href="SchedDev.gmftool#//@palette/@tools.0/@tools.5"/>
<diagramNode
href="SchedDev.gmfgraph#preNode"/>
</ownedChild>
</children>
<children>
<containmentFeature
href="SchedDev.ecore#//TaskType/post"/>
<ownedChild>
<domainMetaElement
href="SchedDev.ecore#//Script"/>
<tool
xsi:type="gmftool:CreationTool"
href="SchedDev.gmftool#//@palette/@tools.0/@tools.6"/>
<diagramNode
href="SchedDev.gmfgraph#postNode"/>
</ownedChild>
</children>
</ownedChild>
The problem ithat, when I try to create the "post" script element, I have an exception:
Caused by: org.eclipse.core.runtime.AssertionFailedException: null argument:failed to create a view (I put the ful lstack at the end of the message).
I think it might be related to this tip: http://wiki.eclipse.org/GMF_Tips#Different_Figures_for_one_E core_class
At least this is all I could find by googleizing the problem. But it is not the same case (i have different roles of the same ecore class).
Please help.
PS. Full stacktrace:
rg.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:519)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:206)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:169)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:399)
at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:411)
at org.eclipse.gmf.runtime.diagram.ui.tools.CreationTool.performCreation(CreationTool.java:133)
at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:178)
at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1064)
at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:263)
at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:374)
at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:538)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:207)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Caused by: org.eclipse.core.runtime.AssertionFailedException: null argument:failed to create a view
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand.doExecuteWithResult(CreateCommand.java:99)
at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:135)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:135)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:135)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:511)
... 37 more
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04933 seconds