Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Hide/remove base_Class property from stereotypes
Hide/remove base_Class property from stereotypes [message #1411564] Sat, 23 August 2014 18:33 Go to next message
Luís de Sousa is currently offline Luís de SousaFriend
Messages: 214
Registered: July 2009
Senior Member
Is there a way to hide or remove the base_Class property that appears together with the properties defined for a stereotype? I am close to deploy a profile and I am pretty sure this generate some confusion to the users.

Thank you.
Re: Hide/remove base_Class property from stereotypes [message #1414230 is a reply to message #1411564] Sat, 30 August 2014 17:41 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de SousaFriend
Messages: 214
Registered: July 2009
Senior Member
The lack of answers points to this being a bug.

I would like to hear how you deal with this issue when deploying a new profile. Do users/clients struggle with it? Or is it something they easily learn to ignore?

Thank you.
Re: Hide/remove base_Class property from stereotypes [message #1414867 is a reply to message #1414230] Mon, 01 September 2014 13:34 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Luis,

Where do you want to hide the base_X property from? Diagram? ModelExplorer? Properties view, when the profile is applied? Elsewhere?

Regards,
Camille


Camille Letavernier
Re: Hide/remove base_Class property from stereotypes [message #1417551 is a reply to message #1411564] Fri, 05 September 2014 17:30 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de SousaFriend
Messages: 214
Registered: July 2009
Senior Member
Hi Camille,

I would just like to remove/hide it from the Profile tab in the Properties view, that is the only place where the base_Class properties are shown to users.

Thank you.
Re: Hide/remove base_Class property from stereotypes [message #1419260 is a reply to message #1417551] Mon, 08 September 2014 10:37 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Luis,

base_X properties should never appear in the Properties view. All Stereotype properties named "base_*" and typed with Element (or a subclass of element) are already filtered out. I can't reproduce your issue

Which build of Papyrus are you using? Is your profile completely valid?

Regards,
Camille


Camille Letavernier
Re: Hide/remove base_Class property from stereotypes [message #1419531 is a reply to message #1419260] Mon, 08 September 2014 19:05 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de SousaFriend
Messages: 214
Registered: July 2009
Senior Member
Hi Camille,

I am using this particular Papyrus build: 0.10.2v201402220559. But this behaviour has been there for a while (I even think I already asked about it here, but I can not find that thread).

I have no problems reported on this profile; it was created a long while ago and is successfully applied to many models.

Thank you,

Luís
Re: Hide/remove base_Class property from stereotypes [message #1419949 is a reply to message #1419531] Tue, 09 September 2014 09:28 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Luis,

I can't reproduce the issue (And the base_X properties have been hidden for as long as I can remember). Maybe a temporary regression on one specific build?

Did you try to update to Papyrus Luna? If you are to release and deploy the profile, I'd recommend using either Papyrus Luna (1.0.0) or Luna SR1 (1.0.1), which will be released at the end of the month (September 26th).

Does this affect all your stereotypes, or only a subset?

Camille


Camille Letavernier
Re: Hide/remove base_Class property from stereotypes [message #1420284 is a reply to message #1419949] Tue, 09 September 2014 19:44 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de SousaFriend
Messages: 214
Registered: July 2009
Senior Member
Hi again Camille,

I installed Luna and Papyrus 1.0.0. The result is exactly the same: multiple base_Class properties are displayed in the Profile tab. This affects all of the stereotypes.

Thank you.
Re: Hide/remove base_Class property from stereotypes [message #1420631 is a reply to message #1420284] Wed, 10 September 2014 08:48 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

I've verified the implementation of the properties view to try to understand in which cases this may happen. The properties view explicitely filters all Extension properties. This requires two conditions:

- The Property is related to an Association (Extension)
- The Property name starts with the "base_" prefix

So, my guess is that you have some properties named "base_*" in your profile, which are not actual extensions. This may have happened after a bug (e.g. an extension not properly deleted may leave one of its properties in the model), or if you explicitely created a property named base_*

You could use the UML2 editor to find and remove such properties: select the properties named base_* in your model, and check their "Association" property. If the "association" property is empty, then you can remove the base_* property (And maybe replace it with a proper extension, if needed)

HTH,
Camille


Camille Letavernier
Re: Hide/remove base_Class property from stereotypes [message #1422706 is a reply to message #1411564] Sat, 13 September 2014 08:15 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de SousaFriend
Messages: 214
Registered: July 2009
Senior Member
Hi Camille,

Here below is a sample of one of the stereotypes defined in this profile:

<eClassifiers xmi:type="ecore:EClass" xmi:id="_jJVh9wYJEeSItoOzkyeFeg" name="Variable" abstract="true">
        <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_jJVh-AYJEeSItoOzkyeFeg" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_fEIqgCBbEeKpfttodweVYA"/>
        <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_jJVh-QYJEeSItoOzkyeFeg" source="duplicates">
          <contents xmi:type="ecore:EReference" xmi:id="_jJVh-gYJEeSItoOzkyeFeg" name="base_Class" ordered="false" lowerBound="1">
            <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_jJVh-wYJEeSItoOzkyeFeg" source="redefines" references="_jJWJAwYJEeSItoOzkyeFeg"/>
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/4.0.0/UML#//Class"/>
          </contents>
          <contents xmi:type="ecore:EReference" xmi:id="_jJVh_QYJEeSItoOzkyeFeg" name="base_Class" ordered="false" lowerBound="1">
            <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_jJVh_gYJEeSItoOzkyeFeg" source="redefines" references="_jJWJAwYJEeSItoOzkyeFeg _jJVh-gYJEeSItoOzkyeFeg"/>
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/4.0.0/UML#//Class"/>
          </contents>
          <contents xmi:type="ecore:EReference" xmi:id="_jJWJAAYJEeSItoOzkyeFeg" name="base_Class" ordered="false" lowerBound="1">
            <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_jJWJAQYJEeSItoOzkyeFeg" source="redefines" references="_jJWJAwYJEeSItoOzkyeFeg _jJVh-gYJEeSItoOzkyeFeg _jJVh_QYJEeSItoOzkyeFeg"/>
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/4.0.0/UML#//Class"/>
          </contents>
        </eAnnotations>
        <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_jJWJAwYJEeSItoOzkyeFeg" name="base_Class" ordered="false" lowerBound="1">
          <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/4.0.0/UML#//Class"/>
        </eStructuralFeatures>
        <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_jJWJBQYJEeSItoOzkyeFeg" name="minValue" ordered="false" lowerBound="1" eType="_jJVh8wYJEeSItoOzkyeFeg" defaultValueLiteral="0"/>
        <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_jJWJBwYJEeSItoOzkyeFeg" name="maxValue" ordered="false" lowerBound="1" eType="_jJVh8wYJEeSItoOzkyeFeg" defaultValueLiteral="0"/>
        <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_jJWJCQYJEeSItoOzkyeFeg" name="stepVariation" ordered="false" lowerBound="1" eType="_jJVh8wYJEeSItoOzkyeFeg" defaultValueLiteral="0"/>
        <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_jJWJCwYJEeSItoOzkyeFeg" name="display" ordered="false" lowerBound="1" eType="_jJVh9QYJEeSItoOzkyeFeg" defaultValueLiteral="false"/>
        <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_jJWJDQYJEeSItoOzkyeFeg" name="initValue" ordered="false" lowerBound="1" eType="_jJVh8wYJEeSItoOzkyeFeg" defaultValueLiteral="0"/>
        <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_jJWJDwYJEeSItoOzkyeFeg" name="initRandom" ordered="false" lowerBound="1" eType="_jJVh9QYJEeSItoOzkyeFeg" defaultValueLiteral="false"/>
      </eClassifiers>

For each stereotype, there are 25 blocks of code similar to this one in the XML file. I guess that whatever is inside the "duplicates" Annotation is shown in the properties view. I tried to remove the entire section or just the the "base_Class" EReference elements (in all the 25 blocks), but the profile becomes invalid.

Another problem with this strategy is that by changing the profile I will have to re-apply it to dozens of models, which will take various days of work.

Thank you,

Luís
Re: Hide/remove base_Class property from stereotypes [message #1424757 is a reply to message #1422706] Tue, 16 September 2014 11:18 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
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 #1426425 is a reply to message #1424757] Thu, 18 September 2014 18:37 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de SousaFriend
Messages: 214
Registered: July 2009
Senior Member
Dear Camille,

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.

In essence we have two problems here:

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.

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".

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.

Regards.

Re: Hide/remove base_Class property from stereotypes [message #1426437 is a reply to message #1426425] Thu, 18 September 2014 19:01 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de SousaFriend
Messages: 214
Registered: July 2009
Senior Member
Hi again Camille,

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?

Beyond this, is there any other fix or workaround I could try? Editing 300 blocks of code by hand does not seem a practical solution in any case.

Thank you.
Re: Hide/remove base_Class property from stereotypes [message #1426792 is a reply to message #1426437] Fri, 19 September 2014 08:11 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
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 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de SousaFriend
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.







Re: Hide/remove base_Class property from stereotypes [message #1442718 is a reply to message #1429485] Sat, 11 October 2014 15:06 Go to previous message
Luís de Sousa is currently offline Luís de SousaFriend
Messages: 214
Registered: July 2009
Senior Member
Dear all,

Since there have been no developments I decided to report the issues raised in this thread as bugs:

Bug 446732 - Filtering for base_Class properties failing
This bug reports the original issue with base_Class properties being shown in the Profile tab of the Properties view.

Bug 446733 - Papyrus might be generating invalid XMI for UML profiles
This bug reports the questions raised by Camille regarding the XMI generated by Papyrus.

Cheers.
Previous Topic:Using OCL constraints in StateInvariant InteractionFragments?
Next Topic:Palette Configuration Model
Goto Forum:
  


Current Time: Fri Mar 29 11:44:50 GMT 2024

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

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

Back to the top