Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » Reuse/extend the UML-RT Capsule Structure Diagram
Reuse/extend the UML-RT Capsule Structure Diagram [message #1749797] Mon, 12 December 2016 12:21 Go to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Hi,

I'd like to reuse/extend the UML-RT Capsule Structure Diagram in my custom Viewpoint configuration and add my own palette to it but I'm not sure how to do it.

From what I see the UML-RT Capsule Structure Diagram is defined as a custom viewpoint diagram in the org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration with the ImmplementationID 'UMLRTCapsuleStructure'.

What I've done is to create a Viewpoint ("Dummy Viewpoint") which has the UMLRT.configuration parent (see the attached viewpoint config file below)

The Dummy Viewpoint adds a diagram ("Dummy Structure Diagram") which has the ImpementationID 'UMLRTCapsuleStructure' and the UMLRT.configuration's UML-RT Capsule Structure Diagram as parent.

To the diagram I then add the same rules as the UML-RT Capsule Structure Diagram has in the UMLRT.configuration.

However, when I rightclick a capsule to create my a new Diagram no popup menu is hown in the model explorer and I get:

!ENTRY org.eclipse.ui 4 0 2016-12-12 11:26:24.315
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.eclipse.papyrus.infra.emf.types.rules.container.InvariantContainerRule.canContain(InvariantContainerRule.java:91)
	at org.eclipse.papyrus.infra.emf.types.rules.container.InvariantContainerRule.approveCreationRequest(InvariantContainerRule.java:37)
	at org.eclipse.papyrus.infra.types.rulebased.core.AbstractRule.approveRequest(AbstractRule.java:39)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.processRule(DefaultRuleEditHelperAdvice.java:210)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.processCompositeRule(DefaultRuleEditHelperAdvice.java:187)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.processRule(DefaultRuleEditHelperAdvice.java:205)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.approveRequest(DefaultRuleEditHelperAdvice.java:220)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.approveRequest(DefaultRuleEditHelperAdvice.java:52)
	at org.eclipse.papyrus.infra.types.core.notification.AbstractNotifierEditHelper.approveRequest(AbstractNotifierEditHelper.java:226)
	at org.eclipse.papyrus.infra.types.core.notification.AbstractNotifierEditHelper.getEditCommand(AbstractNotifierEditHelper.java:57)
	at org.eclipse.gmf.runtime.emf.type.core.MetamodelType.getEditCommand(MetamodelType.java:107)
	at org.eclipse.papyrus.infra.services.edit.internal.ElementEditService.getEditCommand(ElementEditService.java:85)
	at org.eclipse.papyrus.infra.newchild.CreationMenuFactory.buildCommand(CreationMenuFactory.java:393)
	at org.eclipse.papyrus.views.modelexplorer.newchild.ModelExplorerMenuFactory.buildCommand(ModelExplorerMenuFactory.java:71)
	at org.eclipse.papyrus.infra.newchild.CreationMenuFactory.constructMenu(CreationMenuFactory.java:204)
	at org.eclipse.papyrus.infra.newchild.CreationMenuFactory.populateMenu(CreationMenuFactory.java:137)
	at org.eclipse.papyrus.views.modelexplorer.newchild.ModelExplorerDynamicNewChild.fill(ModelExplorerDynamicNewChild.java:72)
	at org.eclipse.ui.internal.menus.DynamicMenuContributionItem.fill(DynamicMenuContributionItem.java:147)
	at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:728)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:810)
	at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:472)
	at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:465)
	at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:497)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:256)
	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:1345)
	at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:198)
	at org.eclipse.swt.widgets.Display.runPopups(Display.java:4595)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4133)
	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)

!ENTRY org.eclipse.ui 4 0 2016-12-12 11:26:24.387
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.eclipse.papyrus.infra.emf.types.rules.container.InvariantContainerRule.canContain(InvariantContainerRule.java:91)
	at org.eclipse.papyrus.infra.emf.types.rules.container.InvariantContainerRule.approveCreationRequest(InvariantContainerRule.java:37)
	at org.eclipse.papyrus.infra.types.rulebased.core.AbstractRule.approveRequest(AbstractRule.java:39)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.processRule(DefaultRuleEditHelperAdvice.java:210)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.processCompositeRule(DefaultRuleEditHelperAdvice.java:187)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.processRule(DefaultRuleEditHelperAdvice.java:205)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.approveRequest(DefaultRuleEditHelperAdvice.java:220)
	at org.eclipse.papyrus.infra.types.rulebased.core.DefaultRuleEditHelperAdvice.approveRequest(DefaultRuleEditHelperAdvice.java:52)
	at org.eclipse.papyrus.infra.types.core.notification.AbstractNotifierEditHelper.approveRequest(AbstractNotifierEditHelper.java:226)
	at org.eclipse.papyrus.infra.types.core.notification.AbstractNotifierEditHelper.getEditCommand(AbstractNotifierEditHelper.java:57)
	at org.eclipse.gmf.runtime.emf.type.core.MetamodelType.getEditCommand(MetamodelType.java:107)
	at org.eclipse.papyrus.infra.services.edit.internal.ElementEditService.getEditCommand(ElementEditService.java:85)
	at org.eclipse.papyrus.infra.newchild.CreationMenuFactory.buildCommand(CreationMenuFactory.java:393)
	at org.eclipse.papyrus.views.modelexplorer.newchild.ModelExplorerMenuFactory.buildCommand(ModelExplorerMenuFactory.java:71)
	at org.eclipse.papyrus.infra.newchild.CreationMenuFactory.constructMenu(CreationMenuFactory.java:204)
	at org.eclipse.papyrus.infra.newchild.CreationMenuFactory.populateMenu(CreationMenuFactory.java:137)
	at org.eclipse.papyrus.views.modelexplorer.newchild.ModelExplorerDynamicNewChild.fill(ModelExplorerDynamicNewChild.java:72)
	at org.eclipse.ui.internal.menus.DynamicMenuContributionItem.fill(DynamicMenuContributionItem.java:147)
	at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:728)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:810)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:669)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer$8.run(MenuManagerRenderer.java:1202)
	at org.eclipse.swt.widgets.Display.timerProc(Display.java:5144)
	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)



The viewpoint configuration file

<?xml version="1.0" encoding="UTF-8"?>
<configuration:PapyrusConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:configuration="http://www.eclipse.org/papyrus/infra/viewpoints/configuration" xmi:id="_utxYkLIcEeanobEfwY7g-w" defaultStakeholder="_FrffsMBOEeaXW62QENb8Aw">
  <stakeholders xmi:id="_FrffsMBOEeaXW62QENb8Aw" name="Dummy Modeler" viewpoints="_FrffscBOEeaXW62QENb8Aw"/>
  <viewpoints xsi:type="configuration:PapyrusViewpoint" xmi:id="_FrffscBOEeaXW62QENb8Aw" name="Dummy Viewpoint">
    <modelKinds xsi:type="configuration:PapyrusDiagram" xmi:id="_FrgGwMBOEeaXW62QENb8Aw" name="Dummy Structure Diagram" icon="platform:/plugin/com.test.ui/icons/icon.png" implementationID="UMLRTCapsuleStructure" categories="_FrijAsBOEeaXW62QENb8Aw" customPalette="platform:/plugin/com.test.ui/models/MyPalette.paletteconfiguration" customStyle="">
      <parent href="platform:/plugin/org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration#_Z79eQHcZEeSnWeKqQOfW2A"/>
       <modelRules xmi:id="_Frgt0MBOEeaXW62QENb8Aw" permit="false">
        <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
      </modelRules>
      <modelRules xmi:id="_JYXn0MBTEeaXW62QENb8Aw"/>
      <owningRules xmi:id="_FrhU4MBOEeaXW62QENb8Aw">
        <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
      </owningRules>
      <childRules xmi:id="_PD0HsMBTEeaXW62QENb8Aw"/>
      <paletteRules xmi:id="_FrhU4sBOEeaXW62QENb8Aw" permit="false" element="composite.group.*"/>
    </modelKinds>
    <parent href="platform:/plugin/org.eclipse.papyrusrt.umlrt.tooling.diagram.common/configuration/UMLRT.configuration#_3T-cEBP7EeSS0oyATXohNA"/>
  </viewpoints>
  <metamodel href="http://www.eclipse.org/uml2/5.0.0/UML#/"/>
  <categories xmi:id="_FrijAsBOEeaXW62QENb8Aw" name="Dummy Model"/>
</configuration:PapyrusConfiguration>

Re: Reuse/extend the UML-RT Capsule Structure Diagram [message #1749961 is a reply to message #1749797] Wed, 14 December 2016 13:45 Go to previous message
Remi Schnekenburger is currently offline Remi SchnekenburgerFriend
Messages: 169
Registered: July 2009
Location: Palaiseau, France
Senior Member
Hi Patrik,

Do you have any issue on startup? Like an exception about an element type model that could not register?

If I look into the InvariantContainerRule class line 91, the element type or its matcher should be null to have a NPE.

Several solutions here
- one of the element types you have declared has issue to load. That is usually because of a wrong id or a configuration file which is not declared or not included in the binary build (never forget the file on the build.properties). There are some junit tests on the Papyrus-RT repository that are looking for such issues => https://git.eclipse.org/c/papyrus-rt/org.eclipse.papyrus-rt.git/tree/tests/junit/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.ui.tests/src/org/eclipse/papyrusrt/umlrt/tooling/ui/tests/configuration/NewChildMenuTest.java or https://git.eclipse.org/c/papyrus-rt/org.eclipse.papyrus-rt.git/tree/tests/junit/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.diagram.statemachine.tests/src/org/eclipse/papyrusrt/umlrt/tooling/diagram/statemachine/editor/tests/RTStateMachineDiagramEditorTests.java
- there is no matcher to your element, which may be a bug in the framework or the declaration of the element. Does the element type congfiguration file validates without any issues?


HTH
Rémi


Remi Schnekenburger

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:RTFactory utility class for Papyrus-RT
Next Topic:Papyrus for Realt Time + Qt GUI + RTOS for full RT application
Goto Forum:
  


Current Time: Fri Apr 26 16:12:33 GMT 2024

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

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

Back to the top