Home » Modeling » Papyrus » Importing UML profile in an Architecture model
Importing UML profile in an Architecture model [message #1799247] |
Mon, 03 December 2018 08:26  |
Eclipse User |
|
|
|
Hi there,
We are trying to create an Architecture model in Papyrus Photon for a customised viewpoint.
I am a bit confused on how one should import an UML profile into the Description language of a Domian.
I have with me a simple uml profile (let's call it simple.profile.uml), when I do a load resource, I cannot locate the Profile in the Description language. Did I do anything wrong? What is the specific steps that I need to follow to refer to an UML profile?
Cheers,
Ran Wei
|
|
| |
Re: Importing UML profile in an Architecture model [message #1799687 is a reply to message #1799671] |
Wed, 12 December 2018 07:00   |
Eclipse User |
|
|
|
Hi Nicholas,
Thank you very much for your response!
The architecture model has got me confused for quite some time. Here's what I have so far:
1) I have defined a simple UML Profile, and created corresponding genmodel, model code, and declared the generated package in plugin.xml. My question with regard to this is: is generating the model code necessary in order to create a customised editor?
2) I have created an architecture model, and load the UML profile in the description language, I have the .typesetconfiguration file generated by Papyrus from my UML profile, and reference it in the architecture model. I have also defined a palette model and referenced it in the architecture model. I have also registered the architecture model in the extension point.
3) I have also created a model creation command, and register the UML profile programmatically like you showed me above.
4) I am able to start a new Eclipse instance, and create a model using my defined architecture model (view point). The model gets created successfully (no exceptions, I am able to see that the profile is applied to the model), but I am unable to create model elements from my defined palette.
I suspected that there may be something wrong with the element types configuration. Could you please may be say a bit more about this?
Thank you very much.
Ran
|
|
| |
Re: Importing UML profile in an Architecture model [message #1800174 is a reply to message #1799694] |
Thu, 20 December 2018 16:46   |
Eclipse User |
|
|
|
Hi Nicolas,
Thanks very much for your response, and apologies for not being able to reply to you sooner.
With regard to your last post:
Quote:
1) Did the created model have the profile applied ? If not, take a look about your creation command class.
Yes the created model have the profile applied.
Quote:
2) Do you have elementtypes defined for semantic and for graphical elements ? If not, i guess it will be the problem. You will define semantic element types inherited UML semantic element types and you will define graphical elements inherited UML graphical elements AND your semantis elements. If you have some problems about that, i can show you a simple example to explain that.
I have defined semantic element types inherited from UML, the graphical elements are the ones that confuse me, it would be great if you could provide a n example on this.
Quote:
3) If you have correctly defined your element types, did the palette reference the graphical element types ?
I referenced the palette definition in the .architecture model, so when a new Eclipse starts up, the viewpoint is there (with the palette).
I am wondering, if you could explain a little bit about the organisations of models in plug-ins? As much as I understood, the profile should be in one plug-in, then another plug-in for elementtypesconfiguration, and then another plug-in for the .architecture model and the palette. If this is the case, then please let me know
1) Do I need to generate the code (also the ecore metamodel) for the profile (i.e. the static profile)?
2) How to reference to the profile in other plugins without starting a new Eclipse instance?
3) How to reference to the elementtypesconfiguration from the architecture model without starting a new Eclipse instance?
Thank you very much for your kind help, it is much appreciated.
Cheers!
Will
|
|
| |
Re: Importing UML profile in an Architecture model [message #1800721 is a reply to message #1800362] |
Mon, 07 January 2019 04:36   |
Eclipse User |
|
|
|
Hi,
I think your problem comes from the graphical element types.
For example, i will show you the class elements types for example :
1) We create a class element type ('UML::Class')
2) We create some graphical element types inherit from the previous metamodel element type ('UML::Class') named 'Class_Shape' and 'Class_Shape_CN'
But for your case, if you just manage stereotypes (as i supposed), you have do these steps:
1) Create your Specialization of your Profile element inherit from the UML metamodel element. For example, if i manage a stereotype on class, i will have this one:
<elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="my.identifier.exampleStereotype" identifier="my.identifier.exampleStereotype" name="ExampleStereotype" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
<iconEntry xmi:type="elementtypesconfigurations:IconEntry" xmi:id="_R-jZsIkOEeiS4samNlCtPg" iconPath="/icons/full/obj16/Class.gif" bundleId="org.eclipse.uml2.uml.edit"/>
<matcherConfiguration xmi:type="stereotypematcher:StereotypeApplicationMatcherConfiguration" xmi:id="_Utj9oIkOEeiS4samNlCtPg" profileUri="http://www.profileuri.com">
<stereotypesQualifiedNames>ExampleProfile::ExampleStereotype</stereotypesQualifiedNames>
</matcherConfiguration>
<specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
</elementTypeConfigurations>
2) After you have to create your own graphical element types depending to this element type created. To continue this example:
<elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="my.identifier.di.exampleStereotype_Class_Shape" identifier="my.identifier.di.exampleStereotype_Class_Shape" name="Example Stereotype (Class_Shape)" hint="Class_Shape" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
<iconEntry xmi:type="elementtypesconfigurations:IconEntry" xmi:id="_gjTvQYmgEeiS4samNlCtPg" iconPath="/icons/full/obj16/ExampleStereotype.gif" bundleId="my.plugin.profile.edit"/>
<specializedTypes xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/my.plugin.types/models/example.elementtypesconfigurations#my.identifier.exampleStereotype"/>
<specializedTypes xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations#org.eclipse.papyrus.umldi.Class_Shape"/>
</elementTypeConfigurations>
3) You have to link your palette element to this graphical element type.
I hope this example helps you for element types.
Concerning the architecture of our plugins, we got this type:
1) We have a plugin for the architecture named 'my.plugin.architecture'
2) We have 2 plugins for profile 'my.plugin.profile' and 'my.plugin.profile.edit'
3) We have a plugin with element types 'my.plugin.types'
4) We have a plugin for the diagram and palette 'my.plugin.class.diagram'
Finally, to answer to your questions :
Quote:1) Do I need to generate the code (also the ecore metamodel) for the profile (i.e. the static profile)?
If you need to manage some dedicated actions while coding, it's better for you to generate the code.
Quote:2) How to reference to the profile in other plugins without starting a new Eclipse instance?
You can reference the profile in your same eclipse instance but you won't have the palette, diagrams, etc. from your plugins. Take care to the URI of your profile (you will have a local URI (something like '../../../test.uml#id' instead of 'platform:/my.plugin.profile/test.uml#id')
Quote:3) How to reference to the elementtypesconfiguration from the architecture model without starting a new Eclipse instance?
You cannot reference it. Your only way to manage it is the export of your plugins into your eclipse instance (like Eclipse plugins)
HTH,
Nicolas
|
|
|
Re: Importing UML profile in an Architecture model [message #1801754 is a reply to message #1800721] |
Fri, 25 January 2019 11:29   |
Eclipse User |
|
|
|
Hello Nicolas,
I am interested in this topic as I'm facing the same scenario as described by the OP.
Unfortunately they have not replied to your latest post yet, so it is not clear if they managed to solve the issue or not.
Basically I'd like to create stereotyped elements from the palette.
I've tried to develop a minimal profile and architecture following this very useful discussion, but at the end it seems i'm missing something: I can create the element from the palette, but without name (minor issue) and, more importantly, without the stereotype!
Maybe there could still be something wrong with the graphical elements?
I've attached the sample profile and architecture to reproduce the behavior.
It would be of great help if you, or anyone else, is willing to have a look at them and tell me if there is something wrong or missing.
Kind Regards,
Nicholas
|
|
| | | | | | | |
Re: Importing UML profile in an Architecture model [message #1804547 is a reply to message #1804546] |
Thu, 28 March 2019 11:39   |
Eclipse User |
|
|
|
Hello Simon,
I've made a bit of progress about this work, but I've not fully solved it.
Currently I'm looking at the available SysML palettes and I'm trying to replicate the same Element Types configuration for my Stereotypes (when applicable).
Of course this method has some shortcomings, for instance I'm not able to create elements with a Stereotype that extends UML::Constraint, because there is no SysML Stereotype that extends it!
I can share the (updated) sample profile and architecture which consists of:
org.example.architecture - which contains the architecture, the elementtypes definitions and the palette definition
org.example.profile - which is the static profile that defines the sample stereotypes.
In particular, regarding the palette definition, I have defined four ToolConfiguration to create as many stereotyped elements . The one that extends Constraint (Criticality Level) is not working, the other three seem fine.
I hope it can be of help...
...and maybe you or someone else will find the solution!
Regards,
Nicholas
|
|
| | | | | | | |
Goto Forum:
Current Time: Thu Apr 24 16:06:12 EDT 2025
Powered by FUDForum. Page generated in 0.04425 seconds
|