Extend existing diagram [message #1771656] |
Tue, 29 August 2017 07:52 |
Ismael Soulama Messages: 39 Registered: November 2016 |
Member |
|
|
Hi,
I want to extend an existing Papyrus diagram (e.g. the statemachine diagram). I want to add new elements in the palette, new properties in object...
Is there a best way, and documeted, to extend the statemachine diagram, and keep usin the papyrus editor?
I eard about a forum last May, but I didn't found the link.
I'm using Papyrus 3.0.0
Best regards
[Updated on: Tue, 29 August 2017 07:53] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: Extend existing diagram [message #1774016 is a reply to message #1773922] |
Mon, 09 October 2017 09:11 |
Adrian Bernal Bermejo Messages: 11 Registered: May 2017 |
Junior Member |
|
|
Hi Ismael,
please check on the properties of the Desciption Language if you have written the correct Creation Command Class: org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand
It is needed to create the model. Choose that default class unless you want to customize the model creation action. I guess that's not the case.
The link to your custom class is applied in your *.elementtypesconfiguration file.
In this example, I create a Package element and then I apply my stereotype.
<elementTypeConfigurations xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" identifier="SIMCANComponentPalette.component.tool.package_1505816000435" name="Scenario (Package)">
<specializedTypes xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations#org.eclipse.papyrus.umldi.Package_Shape"/>
</elementTypeConfigurations>
<adviceBindingsConfigurations xsi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" identifier="SIMCANComponentPalette.component.tool.package_1505816000435_ASAC" target="//@elementTypeConfigurations.0">
<stereotypesToApply stereotypeQualifiedName="SIMCAN::Scenario" updateName="true">
<requiredProfiles>SIMCAN</requiredProfiles>
</stereotypesToApply>
</adviceBindingsConfigurations>
If you want Papyrus to generate automatically the *.elementtypesconfiurations files use the PaletteConfiguration Editor. Since Papyrus 3.0.0 it doesn't come with Papyrus but once you have installed Papyrus Toolsmiths it is available.
How to use PaletteConfiguration Editor: https://www.youtube.com/watch?v=XnhxHPksbjc
There are some problems with the editor, so don't export the palette but go to C:\Users\"user name"\"workspace name"\.metadata\.plugins\org.eclipse.papyrus.infra.gmfdiag.common folder and copy the generated files. I also had problems by trying to edit a generated palette, that it to say, I had to create the palette with the editor at once. If I tried to reopen it, the editor changed the paths by wrong paths.
The files have to be registered for the palette to find them. You shall to registre both of the generated elementtypesconfigurations files with the following extension point:
<extension
point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
<elementTypeSet
clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext"
path="palettes/componentDiagram/SIMCANComponentPalette_Semantic.elementtypesconfigurations">
</elementTypeSet>
</extension>
Regards.
[Updated on: Mon, 09 October 2017 09:15] Report message to a moderator
|
|
|
|
|
Re: Extend existing diagram [message #1774363 is a reply to message #1774285] |
Fri, 13 October 2017 10:05 |
Adrian Bernal Bermejo Messages: 11 Registered: May 2017 |
Junior Member |
|
|
Hi Ismael,
Ismael Soulama wrote on Thu, 12 October 2017 13:24
Is there something missing?
sorry, but I can't know if something is missing by just seeing a piece of code.
Some points to take in account:
- Are you sure your profile is being registered? You should be able to apply it from "Apply registered profile".
- If you want to apply the profile directly to your model when you create it, you must customize your creationCommandClass, as in the library example.
https://github.com/bmaggi/library-training/blob/master/org.eclipse.papyrus.training.library.architecture/src/org/eclipse/papyrus/training/library/architecture/TrainingLibraryModelCreationCommand.java
- If your stereotypes aren't applied on the element when you drag and drop it from your customized palette, review your *.elementtypesconfigurations files.
https://github.com/bmaggi/library-training/blob/master/org.eclipse.papyrus.training.library.newchild/resources/extLibrary.elementtypesconfigurations
https://github.com/bmaggi/library-training/blob/master/org.eclipse.papyrus.training.library.palette/resources/extlibrarydi.elementtypesconfigurations
To know if the elements are being rightly referenced, deploy the plugin and then open the palette model and the element type set models (*.elementtypesconfigurations files) and show the Properties tab. you should be able to navigate through the whole models. If some reference is wrong, you will get an error, so you will know what reference is wrong.
Regards.
[Updated on: Fri, 13 October 2017 10:38] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02721 seconds