Editing the values of a composite association from Stereotype to class [message #1746739] |
Thu, 03 November 2016 18:10  |
Eclipse User |
|
|
|
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] |
Wed, 16 November 2016 19:25   |
Eclipse User |
|
|
|
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.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07335 seconds