Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Editing the values of a composite association from Stereotype to class
Editing the values of a composite association from Stereotype to class [message #1746739] Thu, 03 November 2016 22:10 Go to next message
Vetle Volden-Freberg is currently offline Vetle Volden-FrebergFriend
Messages: 39
Registered: February 2016
Member
Hello!
I am currently making a profile for a DSML in Papyrus.

So far I have made a stereotype of <<metaclass Message>>, "<<stereotype>> RiskyMessage" and I want this stereotype to have a composite association to a Frequency class. The Frequency class will be abstract as it will have two generalizations, namely IntervalFrequency and ExactFrequency. This is because I want the user to be able to specify a frequency in the manner: <min, max> / timeUnit or exact / timeUnit.

I validate the model and everything is fine.
However when I try to use my RiskyMessage stereotype in a Sequence Diagram and create either the IntervalFrequency or ExactFrequency through the properties widget, I am not allowed to change any of the values in these classes. At least not directly in the GUI, as you would do in e.g a datatype.

I also tried this using an abstract datatype Frequency and having two generalizations of this, but then I could only choose the Frequency datatype in the properties widget for RiskyMessage (when creating a model).


Any ideas on how to solve this issue?


Thanks in advance,

Vetle VF.
Re: Editing the values of a composite association from Stereotype to class [message #1747938 is a reply to message #1746739] Thu, 17 November 2016 00:25 Go to previous messageGo to next message
Sebastien Revol is currently offline Sebastien RevolFriend
Messages: 14
Registered: July 2015
Location: Grenoble, France
Junior Member
Hi Vetle,
Unfortunately, I think that Papyrus properties view is currently not designed to support such use case.
In practice, a profile definition leads to a new ecore metamodel definition. Stereotypes are transformed into EClass with a EReference to the base UML metaclass it is extending. UML Classes or DataType in profiles are also transformed into EClasses.
In a UML model using this profile, a stereotype application is in practice an instanciation of the corresponding EClass. Currently the properties view only allows to specify values for the properties of those stereotype applications.
As you mentionned, it is also allowing the creation of instances of EClass coming from UML Classes in profiles, but I'm afraid it is not possible to edit their properties.

Maybe, a possible workaround can be to rely on the properties view generator to create a custom properties editor for your profile, (http://help.eclipse.org/neon/topic/org.eclipse.papyrus.views.properties.doc/target/generated-eclipse-help/properties-view.html?cp=65_1_1_0_5#Generation_Tool and maybe (not tested), you will have a custom tab for your IntervalFrequency and ExactFrequence EClasses, that you could open with double click on the instance after its creation.

Else, the low cost solution is to merge all the attributes in the RiskyMessage stereotype, and implement validation rules to ensure that users exclusively use <min/max> or exact tag values.

Last, to be complete, MARTE Value Specification Language http://www.omg.org/omgmarte/Documents/tutorial/part2.pdf was precisely designed for that purpose, standardizing a textual syntax for DataType instanciation. But I'm not sure the tooling around this is fully implemented/operationnal.
Re: Editing the values of a composite association from Stereotype to class [message #1747952 is a reply to message #1747938] Thu, 17 November 2016 09:23 Go to previous messageGo to next message
Vetle Volden-Freberg is currently offline Vetle Volden-FrebergFriend
Messages: 39
Registered: February 2016
Member
Hello Sebastien.
Thank you for your elaborate answer. So far I have gone with having a Datatype Frequency which only contains min, max and a timeunit.

You say that Datatype and Stereotypes are "transformed into EClass with a EReference to the base UML metaclass it is extending". For Datatypes however, it is possible to edit their properties with the Papyrus properties view, but not for stereotypes. If you try to edit the properties of a stereotype it asks for a container for the object being created.

I think I will go with having two different Frequency datatypes in the end, and as you say implement validation rules to ensure that users exclusively use the IntervalFrequency- or ExactFrequency - datatype. As this seems to be the most straightforward solution, although not the prettiest.

I was however a bit surprised that abstract datatypes did not behave like abstract classes. As I said in my original post I tried to have one abstract datatype Frequency with generalisations IntervalFrequency and ExactFrequency. But upon instantiation of the datatype in say RiskyMessage it would instantiate the abstract type.


Regards, Vetle VF.
Re: Editing the values of a composite association from Stereotype to class [message #1747969 is a reply to message #1747952] Thu, 17 November 2016 11:02 Go to previous messageGo to next message
Sebastien Revol is currently offline Sebastien RevolFriend
Messages: 14
Registered: July 2015
Location: Grenoble, France
Junior Member
Hello Vetle,
my bad, I answered without testing, and it occurs that things have changed since last time I tried the same kind of things.

So you're right, it's recommanded to use data types instead of classes or stereotypes, since the property view now allows edition of data type attributes.
The missing thing is that the "green cross" button should ask for the concrete DataType you want to use when the type property's type is abstract.

I think you can open a bug for this feature.
Re: Editing the values of a composite association from Stereotype to class [message #1747976 is a reply to message #1747969] Thu, 17 November 2016 12:03 Go to previous message
Vetle Volden-Freberg is currently offline Vetle Volden-FrebergFriend
Messages: 39
Registered: February 2016
Member
Hello Sebastien.
I agree with you, I have opened a bug report for this feature.

See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=507671

Regards, Vetle VF.

[Updated on: Thu, 17 November 2016 12:04]

Report message to a moderator

Previous Topic:Setting the EClass of a Metamodel Type configuration?
Next Topic:Exception running Moka example
Goto Forum:
  


Current Time: Thu Apr 25 00:18:25 GMT 2024

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

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

Back to the top