|
|
|
|
|
|
|
|
|
|
Re: Hide/remove base_Class property from stereotypes [message #1424757 is a reply to message #1422706] |
Tue, 16 September 2014 11:18 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi Luis,
The duplicates shouldn't happen. Maybe you specified too many extension links to the same metaclass? For example, you may have specified that Stereotype S1 is an extension of Class, and that the Stereotype S2, which is a specialization of S1, also is an extension of Class? (In which case you have specified the same information twice)
However, if I reproduce these steps, I indeed have a "duplicates" annotation in my profile, but still don't see any "base_X" reference in my properties view. So this is not sufficient.
The Ecore definition itself seems valid, but Papyrus also needs to check the actual profile. For example, your base_X properties should look like the following:
<packagedElement xmi:type="uml:Stereotype" xmi:id="_V1zaID2SEeSJvbA25IPzgA" name="Stereotype2">
<ownedAttribute xmi:type="uml:Property" xmi:id="_XeFmkD2SEeSJvbA25IPzgA" name="base_Class" association="_XeFmkT2SEeSJvbA25IPzgA">
<type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
</ownedAttribute>
</packagedElement>
With an "association=_xxxxxxxx" attribute (Otherwise it is considered to be a standard Property; not a metaclass extension; and it will be displayed in the properties view)
Camille Letavernier
|
|
|
|
|
Re: Hide/remove base_Class property from stereotypes [message #1426792 is a reply to message #1426437] |
Fri, 19 September 2014 08:11 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi Luis,
Quote:So when you write "duplicates shoudn't happen" this means something is going wrong.
I meant "If the profile is valid/doesn't duplicate information itself" (In which case the Ecore duplicates would indeed be expected and perfectly valid). So to rephrase:
> The duplicates shouldn't happen, unless you specified too many extension links to the same metaclass (or other kinds of duplicate information in the profile). Duplicates are not a bug, they are just useless information.
Quote:All these stereotypes specify a single extension from the metaclass Class. This profile has never changed in this respect, alterations have been made mostly to properties.
The right question is: do you have some cases where "Stereotype A" extends <<Metaclass>> Class, and "Stereotype B" extends <<Metaclass>> Class, and "Stereotype B" extends "Stereotype A"? (This is a kind of duplicate information, since Stereotype B would already inherit the extension to <<Metaclass>> Class, and doesn't need to re-specifiy it)
Quote:1. Papyrus is generating invalid or incorrect XMI. I have never edited the file in text mode, it was all generated by Papyrus. So when you write "duplicates shoudn't happen" this means something is going wrong.
Then again, I don't know whether the Ecore is invalid because the transformation is invalid, or because the Profile itself contains "errors" (Not Errors from a UML point of view, but from a human point of view). In the later, this wouldn't be a Papyrus bug. But since I still haven't seen any single bit of your UML Profile, I can't tell at this point.
Quote:2. The filter for base_* properties is not working properly. It is not obvious why the filter should function on "Property" elements and not on "EReference".
Same thing: if the profile itself incorrectly specifies its base_* properties, then they won't be filtered. Whether it is the filter or the profile which is invalid remains to be seen. Looking at the filter implementation though, it seems perfectly valid
Quote:Even if modifying the file in text mode was a solution (so far removing any elements results in an invalid profile) this would mean editing by hand close to 300 blocks of code. I'll keep trying, but this is definitely a bug, or a series a bugs, and relatively serious in my view.
I never suggested that: I'm still trying to understand why these duplicates appear in the first time, and why they should be a problem. When I tested, I've been indeed able to produce "duplicates" (By indeed duplicating information in the Profile, which is legal but useless), but this never caused the base_* properties to appear in the properties view.
Quote:An immediate problem with your latest solution is the id to use in the association property. Could you please transform the stereotype I posted above into something that Papyrus is able to digest properly?
I can't; you never posted any stereotype (Only its Ecore definition, i.e. post-transformation/definition result). What I need is the actual <uml:Stereotype>....</uml:Stereotype>
Camille
Camille Letavernier
|
|
|
Re: Hide/remove base_Class property from stereotypes [message #1429485 is a reply to message #1426792] |
Tue, 23 September 2014 09:38 |
Luís de Sousa Messages: 214 Registered: July 2009 |
Senior Member |
|
|
Hi again Camille, some answers to your questions.
Quote:The duplicates shouldn't happen, unless you specified too many extension links to the same metaclass (or other kinds of duplicate information in the profile). Duplicates are not a bug, they are just useless information.
In my view, if these duplicates should not happen, and are happening then you have a bug. This is one of the classical definitions of a bug: unexpected behaviour.
Quote:The right question is: do you have some cases where "Stereotype A" extends <<Metaclass>> Class, and "Stereotype B" extends <<Metaclass>> Class, and "Stereotype B" extends "Stereotype A"? (This is a kind of duplicate information, since Stereotype B would already inherit the extension to <<Metaclass>> Class, and doesn't need to re-specifiy it)
Again: no, I never had this kind of structure. Note also that these "duplicates" are present in every stereotype, where in this example you would expect duplicates only in "Stereotype B".
Quote:Whether it is the filter or the profile which is invalid remains to be seen.
What would you need to know to be certain? And again, in either case it is bug: either Papyrus is generating invalid XMI or the filter is failing.
Quote:What I need is the actual <uml:Stereotype>....</uml:Stereotype>
Well, then we definitely have problem since there is no such thing in this profile. Perhaps you are referring to a different version of Papyrus? Again, I am using version 0.10.2.
I already posted the complete code block for a stereotype above thread. If this code is not what you expect then this problem should be scaled up to bug status.
Thank you.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03963 seconds