Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Papyrus Architecture Model - Oxygen (Creation Command Class issue)
Papyrus Architecture Model - Oxygen (Creation Command Class issue) [message #1770689] Wed, 16 August 2017 09:26 Go to next message
Daniel Clarke is currently offline Daniel ClarkeFriend
Messages: 24
Registered: March 2016
Junior Member
Hi,

I'm trying to move my eclipse plugin from Eclipse Neon to Eclipse Oxygen. I previosly had a profile, type library, viewpoint and some custom CSS in the Eclipse plugin.

It seems Papyrus in Oxygen has introduced the concept of an architecture model (to replace viewpoints?), but I cannot figure out how to get this to work. I'm looking at the documentation here http://help.eclipse.org/oxygen/index.jsp "Papyrus Guide - Toolsmith Guide - Architecture Contexts - Definition of New Architecture Models", but I don't understand exactly how it is meant to work.

I think I've followed the "Walkthrough" instructions correctly upto point 4, but I cannot seem to assign a Creation Command Class. I've created a class which extends ModelCreationCommandBase, but when I attempt to input the fully qualified class name in the field I get "WrappedException: java.lang.ClassNotFoundException my.package.hierarchy.myClassName cannot be found by org.eclipse.emf.ecore_2.13.0.v20170503-0428.

Then it just deletes the entry in the field. Have I missed a step somewhere?

Any help is appreciated - is there an example architecture model somewhere I can look at?

Thanks,
Dan
Re: Papyrus Architecture Model - Oxygen (Creation Command Class issue) [message #1770694 is a reply to message #1770689] Wed, 16 August 2017 09:40 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 885
Registered: February 2011
Senior Member
Hi Dan,

I think that's a bug/problem with the architecture framework model. You can only reference a class if it is already deployed in your target platform (Which is usually not the case at development time). One way to do this is to have your plugin in an Eclipse instance, compile it, and start a runtime Eclipse instance from there. In this runtime instance, you should then be able to edit your *.architecture file and properly reference the java class.

HTH,
Camille


Camille Letavernier
Re: Papyrus Architecture Model - Oxygen (Creation Command Class issue) [message #1770705 is a reply to message #1770694] Wed, 16 August 2017 11:16 Go to previous messageGo to next message
Daniel Clarke is currently offline Daniel ClarkeFriend
Messages: 24
Registered: March 2016
Junior Member
Camille,

Thanks for the quick response - have done as you suggested and that worked :)

Next problem...I can now create a new Papyrus model, select my "test" architecture context, which allows me to select my test viewpoint. Once the model is loaded, it has created a root element, applied my profile and imported my types library - all good.

However, I am unable to add anything to the model. Right-clicking on the RootElement in the Model Explorer does not bring up the "New Child" or "New Relationship" options, and although the "New Diagram" option is visible, it contains no diagrams and greys out when you hover over it.

I'm guessing there is something I haven't understood again in the architecture model. Not sure if it's of any use but my model file is:

<?xml version="1.0" encoding="UTF-8"?>
<architecture:ArchitectureDomain xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:architecture="http://www.eclipse.org/papyrus/infra/core/architecture" xmlns:gmfdiagrepresentation="http://www.eclipse.org/papyrus/infra/gmfdiag/representation" xmi:id="_qquTgIGZEeewcev4-FF3Fg" name="Test" description="Test">
  <stakeholders xmi:id="_3Mz7EIGZEeewcev4-FF3Fg" name="Test System Designer" description="Test System Designer" concerns="_0cCckIGZEeewcev4-FF3Fg"/>
  <concerns xmi:id="_0cCckIGZEeewcev4-FF3Fg" name="System Design" description="Test System Design"/>
  <contexts xsi:type="architecture:ArchitectureDescriptionLanguage" xmi:id="_ElbiAIGaEeewcev4-FF3Fg" name="Test UML" description="Test UML" defaultViewpoints="_EhYTAIGbEeewcev4-FF3Fg" id="uml" icon="platform:/plugin/org.eclipse.papyrus.uml.diagram.component/icons/obj16/ComponentDiagram.gif" creationCommandClass="test.uml.CreateTestModelCommand">
    <viewpoints xmi:id="_EhYTAIGbEeewcev4-FF3Fg" name="Test UML" description="Test UML Viewpoint" concerns="_0cCckIGZEeewcev4-FF3Fg" representationKinds="_R93GQIGbEeewcev4-FF3Fg" id="viewpoint"/>
    <representationKinds xsi:type="gmfdiagrepresentation:PapyrusDiagram" xmi:id="_R93GQIGbEeewcev4-FF3Fg" name="Types Diagram" description="Types Diagram" concerns="_0cCckIGZEeewcev4-FF3Fg" icon="platform:/plugin/org.eclipse.papyrus.uml.diagram.clazz/icons/obj16/Diagram_Class.gif" implementationID="PapyrusUMLClassDiagram" customStyle="platform:/plugin/test.uml/resources/css/test_uml.css" creationCommandClass="org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand">
      <modelRules xmi:id="_o-_fkIGbEeewcev4-FF3Fg">
        <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
      </modelRules>
      <owningRules xmi:id="_xtC00IGbEeewcev4-FF3Fg">
        <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
      </owningRules>
      <childRules xmi:id="_uhSd8IGwEeewcev4-FF3Fg"/>
    </representationKinds>
    <metamodel href="http://www.eclipse.org/uml2/5.0.0/UML#/"/>
    <profiles href="http://www.eclipse.org/uml2/5.0.0/UML#/"/>
  </contexts>
</architecture:ArchitectureDomain>


Is there something obvious I've missed, or is there an example file I can look at for guidance?

Thanks again,
Dan
Re: Papyrus Architecture Model - Oxygen (Creation Command Class issue) [message #1770710 is a reply to message #1770705] Wed, 16 August 2017 11:47 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 885
Registered: February 2011
Senior Member
Hi,

One major difference in the Architecture Framework from Oxygen compared to the Viewpoints from Neon is that you have to specify everything you want to reuse from Papyrus/UML. By default, you won't be able to create/edit anything. This is useful because this avoids being affected by other project's contributions and allows you to get rid of the UML complexity, but it can be painful when you actually want to add a few things on top of UML (I'm not sure if there is a way to reuse/extend an Architecture Framework).

In practice, this means that you have to load all Element Types models that you want to reuse from Papyrus, and reference the ElementTypeSets they contain. The problem is, the tooling won't really help you with that (AFAIK).

To do that, you need to:

- Identify all Element Type models you want to reuse (e.g. open Papyrus' uml.architecture model from org.eclipse.papyrus.uml.architecture, find "Description Language UML", and check the value of the "Element Types" property)
- In your architecture model, use the "Load resource" context menu to load each Element Types model referenced there
- In your Description Language, add all required "Element Type Sets" to the element types property

Problem: the "Load resource" dialog doesn't help you finding the element type models in any way (And I've not seen any tool to help you do that, although I might just have missed it). So unless you know where the element type models are located, and how to write the corresponding EMF URI, I'd recommend cheating a little bit:

- Open the XMI from uml.architecture with a text editor
- Find all <element types /> tags for the UML Architecture model
- Copy/Paste to your own Architecture XMI
- Open the editor and check that everything is still valid. Eventually remove what you don't need

I'm not sure, but you may also have to copy the "Papyrus Diagram" elements, if you want to reuse some/all Papyrus Diagrams (Or maybe it could be sufficient to just reference them from your own viewpoint, in the "Representation Kinds" property)

Camille


Camille Letavernier
Re: Papyrus Architecture Model - Oxygen (Creation Command Class issue) [message #1770713 is a reply to message #1770710] Wed, 16 August 2017 12:06 Go to previous messageGo to next message
Daniel Clarke is currently offline Daniel ClarkeFriend
Messages: 24
Registered: March 2016
Junior Member
Camille,

I'll have a play and see if I can figure it out :)

Again, many thanks
Re: Papyrus Architecture Model - Oxygen (Creation Command Class issue) [message #1770798 is a reply to message #1770713] Thu, 17 August 2017 07:52 Go to previous messageGo to next message
Daniel Clarke is currently offline Daniel ClarkeFriend
Messages: 24
Registered: March 2016
Junior Member
Just a quick update...

I've sort of got something working - in that I can now create a class diagram and can now add elements to my model. However, I cannot figure out how to tailor it to do what I want... I did this as you suggested, by copying the elementTypes from the UML architecture model (and also the representationKinds for the class diagram - just had to change the "concerns" reference.

    <elementTypes href="platform:/plugin/org.eclipse.papyrus.infra.emf/model/infra-emf.elementtypesconfigurations#_rWI4YHPzEeSnGJwaJWHCSg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/model/notation.elementtypesconfigurations#_ScP1oFYCEeS0WsAAtVmToA"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/model/gmfdiag-common.elementtypesconfigurations#_rWI4YHPzEeSnGJwaJWHCSg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.infra.nattable/model/nattable-tablecontents.elementtypesconfigurations#_rWI4YHPzEeSnGJwaJWHCSg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.infra.nattable/model/nattable-tablecontext.elementtypesconfigurations#_rWI4YHPzEeSnGJwaJWHCSg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.infra.nattable.common/model/nattable-common.elementtypesconfigurations#_rWI4YHPzEeSnGJwaJWHCSg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.infra.services.controlmode/model/controlmode.elementtypesconfigurations#_rWI4YHPzEeSnGJwaJWHCSg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.infra.services.edit/model/marker.elementtypesconfigurations#_rWI4YHPzEeSnGJwaJWHCSg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.infra.types.rulebased/model/rulebased.elementtypesconfigurations#_ScP1oFYCEeS0WsAAtVmToA"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.elementtypesconfigurations#_x8G0YGaNEeSyJIsxLao1Pw"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.elementtypesconfigurations#_rWI4YHPzEeSnGJwaJWHCSg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.diagram.communication/model/communicationdiagram.elementtypesconfigurations#_rWI4YHPzEeSnGJwaJWHCSg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.elementtypesconfigurations#_tL86sLazEeSbnofizoRSMQ"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.diagram.interactionoverview/model/interactionOverviewDiagram.elementtypesconfigurations#_x8G0YGaNEeSyJIsxLao1Pw"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.elementtypesconfigurations#_wYwtMMeDEeSwP_9Vn5UnWg"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.diagram.stereotype.edition/model/stereotype-edit.elementtypesconfigurations#_ScP1oFYCEeS0WsAAtVmToA"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.diagram.timing/model/timingdiagram-uml.elementtypesconfigurations#_BJMa0PyeEeWbo9Y7g2MLdw"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#_ScP1oFYCEeS0WsAAtVmToA"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml-containments.elementtypesconfigurations#_ScP1oFYCEeS0WsAAtVmToA"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/StandardProfile.elementtypesconfigurations#_jfoLkGT_EeSEqNuV3JpFCA"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations#_ScP1oFYCEeS0WsAAtVmToA"/>
    <elementTypes href="platform:/plugin/org.eclipse.papyrus.uml.service.types.ui/model/uml-advice.elementtypesconfigurations#_ScP1oFYCEeS0WsAAtVmToA"/>
    <representationKinds xsi:type="gmfdiagrepresentation:PapyrusDiagram" xmi:id="_zzf4gHDtEeWh-MssWmCB_A" name="Class Diagram" concerns="_0cCckIGZEeewcev4-FF3Fg" icon="platform:/plugin/org.eclipse.papyrus.uml.diagram.clazz/icons/obj16/Diagram_Class.gif" implementationID="PapyrusUMLClassDiagram" creationCommandClass="org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand">
      <modelRules xmi:id="_zzf4gXDtEeWh-MssWmCB_A">
        <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
      </modelRules>
      <owningRules xmi:id="_zzf4gnDtEeWh-MssWmCB_A">
        <element href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
      </owningRules>
      <childRules xmi:id="_zzf4g3DtEeWh-MssWmCB_A"/>
      <palettes href="platform:/plugin/org.eclipse.papyrus.uml.diagram.clazz/model/PapyrusUMLClassDiagram.paletteconfiguration#/"/>
    </representationKinds>


I don't really understand the concept of the elementTypes, so it is difficult to understand exactly what I need to do...

Basically, all I'm after is creating a model using theUML profile I defined, whereby I can create a set of UML diagrams (class, composite structure, deployment) and create stereotyped elements from my profile (so normal UML diagrams but with a custom palette so you can easily add the stereotyped elements. The palette configuration seems to have changed as well? I used to use an XML file in Neon, but it won't let me select this anymore in the representation kind).

Is there an example project I can use for reference on how to do this? I was looking at the RobotML project for guidance on Neon, but that doesn't appear to have been updated for Oxygen?

I think I'm going to struggle to figure out how to do this without a realworld example.

Thanks,
Dan
Re: Papyrus Architecture Model - Oxygen (Creation Command Class issue) [message #1770799 is a reply to message #1770798] Thu, 17 August 2017 08:09 Go to previous message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 885
Registered: February 2011
Senior Member
Hi,

In Oxygen, the palettes are now defined using an XMI Model. The Papyrus Toolsmith feature *might* include a migration tool from the XML Palettes, but I'm not sure. You may find examples in SysML 1.4 [1] [2], Papyrus-RT [3] or Papyrus-IM [4]. I think Papyrus-RT and Papyrus-IM depend on a nightly build of Papyrus (Targetting Papyrus 3.1.0, which will be released end of September). Papyrus-IM is the simplest customization (1 diagram, 1 architecture model, reusing the Class Diagram with a filtered palette, but no profile or new palette elements), whereas SysML 1.4 should pretty much be a full customization (Including custom diagram elements). Papyrus-RT probably includes the most examples of custom behaviors/model structure and may be quite complex.

Note that the diagrams (For SysML and Papyrus-RT) may be defined in a separate plug-in to the architecture model. I've added two links for SysML; the first one to the architecture model (top-level entry point for the end-user), and the second one to the diagram (implementation). The architecture model references elements defined in the diagram implementation models.

You may need to define element types models to be able to create Stereotyped Elements from the palette, as the XMI palette no longer works with "Post-actions". Element types are related to all semantic creation/edition operations, which includes applying stereotypes.

[1] http://git.eclipse.org/c/gerrit/papyrus/org.eclipse.papyrus-sysml.git/tree/gui/org.eclipse.papyrus.sysml14.architecture/resources
[2] http://git.eclipse.org/c/gerrit/papyrus/org.eclipse.papyrus-sysml.git/tree/diagram/org.eclipse.papyrus.sysml14.diagram.blockdefinition/resources
[2] http://git.eclipse.org/c/gerrit/papyrus-rt/org.eclipse.papyrus-rt.git/tree/plugins/umlrt/tooling/org.eclipse.papyrusrt.umlrt.tooling.architecture/architecture
[3] http://git.eclipse.org/c/gerrit/papyrus/org.eclipse.papyrus-informationmodeling.git/tree/plugins/org.eclipse.papyrus.information.modeling.core/resource/architecture

Camille


Camille Letavernier
Previous Topic:Definition of Java-Constraints in UML Profile
Next Topic:Need up to date instructions for SysML Parametric Modelling
Goto Forum:
  


Current Time: Wed Sep 19 07:17:03 GMT 2018

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

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

Back to the top