Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Any way to change an element type?
Any way to change an element type? [message #1848669] Mon, 13 December 2021 15:29 Go to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Sorry if this is obvious but, having just spent some time fruitlessly looking for this feature, I thought I'd have to ask...

If I create an object in a class diagram, a class, for example, is there a way that I can later change it to be an "interface"? Similarly with associations; if I uses the little drag lines and create an "association edge", how do I change it to, for example, a "Shared Association (Directed)" edge?
Re: Any way to change an element type? [message #1848673 is a reply to message #1848669] Mon, 13 December 2021 16:15 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 495
Registered: May 2015
Location: Germany
Senior Member
I hope Eclipse Papyrus will never support transforming an UML:: Class element into an UML:: Interface element. Just because an UML:: Interface element can NOT substitute (in the sense of the Liskov Substitution Principle) an UML:: Interface element.

UML:: Class is derived from UML::BehavioredClassifier and UML::EncapsulatedClassifier. UML::Interface is derived from UML::Classifier.

How should something which has NO behavior and can NOT encapsulate other elements substitute something with behavior that can encapsulate other elements?

/Carsten
Re: Any way to change an element type? [message #1848676 is a reply to message #1848673] Mon, 13 December 2021 17:26 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Carsten,

The question regarding classes and interfaces is that, since an interface is a model element that defines a set of operations that other model elements, such as classes, or components must implement, if I, let's say accidentally, realised half way through that the "class" I'd added and filled in was, in fact, totally abstract and was, therefore, an interface in those terms, why would there be a semantic issue in trying to convert the representation in Papyrus to an interface?

Also, from the point of view of associations, since the "quick link" feature (or whatever it's called), when one end is connected to another element, pops up a list of 9 edges (a small subset of the total), if I select an Association Edge there, how can I constrain the association to be, for example, directional, Composite or Shared, and so on, since the "Properties" page of a plain Association Edge has very few options available.

I feel like I must be missing something, since this functionality has been in every other UML tool I've used.
Re: Any way to change an element type? [message #1848691 is a reply to message #1848676] Tue, 14 December 2021 07:45 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 495
Registered: May 2015
Location: Germany
Senior Member
Hi John,

yes there are some so called UML tools, that support such transformation. These kind of UML tools featuring a UML shapes set, maybe also an element tree, but neither respect the UML metaclass hierarchy nor the UML OCL rules. Papyrus does both respect the UML metaclass hierarchy and the UML OCL rules. This is the reason why Papyrus do not offer transformation, that will break with the UML metaclass hierarchy or the UML OCL rules.

BTW, feel free to create a set of custom model-to-model transformations to fit your needs. ATL (Atlas Transformation Language) is well fitted for such jobs.

/Carsten
Re: Any way to change an element type? [message #1848694 is a reply to message #1848691] Tue, 14 December 2021 09:03 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Whether or not Papyrus respects the metaclass hierarchy is irrelevant to this question of changing the nature of an element. The semantic difference between an "abstract class with all abstract methods, zero attributes and zero (owned) associations" and an "interface" is small and there should be no substantial issues in allowing a class of that type to be converted to an "interface" within the tool such that its representation, in a class diagram, matches the style of other interfaces.

TBH I don't really understand your objection; UML is a method of describing a design and, under normal circumstances, the design process will be iterative, even, in a lot of cases, before a line of code is written. If a UML design/diagramming 'tool' is not capable of supporting that iterative process in an efficient and effective way, for example by allowing elements to be transformed where it is clear from review that a mistake has been made (rather than having to create a new element of the 'correct' type and fill in all the detail again), then it's not fit for purpose.

Ultimately, however, while I appreciate you taking the time to respond, other than an implied "no, it's not possible" for the class - > interface question, you're not answering my questions. I'm not really interested in the intricacies of how Papyrus works, I'm just looking for a tool that will allow me to create accurate (in terms of style) UML diagrams, in an efficient and effective manner, that help to communicate ideas rather than being a 100% accurate representation of my code.

I've looked at Papyrus many times over the years, and had hoped, by now, that it would be capable of supporting my needs but, sadly it seems that it doesn't and, assuming you're commenting as someone with a close relationship to the project, it sounds like it never will.

FWIW, this isn't me having an inappropriate moan about software that's 'free'; we're happy to pay for a good tool that saves us time and effort. Sadly the one we've already paid for has, over the last few years, gone down a route where it fails to do that (Enterprise Architect) and someone in my company appears to be unhappy to buy an alternative due to their geographical location! Hence I'm just looking at alternatives, of which Papyrus is one. However Sequence Diagrams, which are ones I use a great deal, seem to be particularly buggy and neglected in Papyrus, so that was likely to be the point where I abandoned anyway.
Re: Any way to change an element type? [message #1848698 is a reply to message #1848694] Tue, 14 December 2021 10:23 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 495
Registered: May 2015
Location: Germany
Senior Member
Sparx Enterprice Architect is such a UML tool I personally classify as an el cheapo PowerPoint or Visio alternative ;-)

geographical location? Belarus?

Maybe Modelio (https://www.modelio.org/) better fits your needs?
Re: Any way to change an element type? [message #1848715 is a reply to message #1848698] Tue, 14 December 2021 20:01 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, John,

Papyrus does not provide the morphing tool that you're looking for to change an object from one (meta)class to another, such as Class to Interface. However, you can create your new interface and copy/paste much of the contents of the class (attributes and operations especially) into the new Interface and then just redraw relationships to the new interface. That should at least accelerate the replacement procedure.

But the situation with your composition associations is simpler, as no such reclassification of model elements is needed. The composite-ness is just an attribute of one association end. Just change the "composition" attribute of that end (in the Properties view) to some other value, such as "shared" or "none". Similarly, directed-ness of the association is just a reflection of whether an association end is owned by the association or by the classifier at that end. So, in the Model Explorer, you can drag-and-drop association ends from the association to an associated classifier or vice-versa to change whether an end is navigable and, hence, whether the association is "directed" or not.

HTH,
Christian
Re: Any way to change an element type? [message #1848716 is a reply to message #1848715] Tue, 14 December 2021 20:57 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Christian Damus wrote on Tue, 14 December 2021 15:01
Hi, John,

Papyrus does not provide the morphing tool that you're looking for to change an object from one (meta)class to another, such as Class to Interface. However, you can create your new interface and copy/paste much of the contents of the class (attributes and operations especially) into the new Interface and then just redraw relationships to the new interface. That should at least accelerate the replacement procedure.


Thank you Christian; that's unfortunate that it can't be done. The workaround is one I've used already, but it seemed (as I described above) that it should require a trivial action from a user to convert an abstract class with abstract <blah blah as above> into an interface.

Christian Damus wrote on Tue, 14 December 2021 15:01
But the situation with your composition associations is simpler, as no such reclassification of model elements is needed. The composite-ness is just an attribute of one association end. Just change the "composition" attribute of that end (in the Properties view) to some other value, such as "shared" or "none". Similarly, directed-ness of the association is just a reflection of whether an association end is owned by the association or by the classifier at that end. So, in the Model Explorer, you can drag-and-drop association ends from the association to an associated classifier or vice-versa to change whether an end is navigable and, hence, whether the association is "directed" or not.

HTH,
Christian


Would you be able to spare some time to pop some screenshots on of where to find this stuff? I'm using the 2021-09 version of Papyrus that I downloaded yesterday from the Eclipse site; I'd used the latest in an Eclipse 2021-12 version to start with, but was having issues with the Sequence Diagram editor so thought I'd try something that wasn't full of unnecessary plug-ins like my current CDT-based install of Eclipse is.

However, if I create a new project, add a couple of classes, drag the link thing across, select "association edge" and look at the "Properties", the "UML" tab shows as in assoc1.jpg.

index.php/fa/41450/0/

I did find a "decoration" setting under "Appearance" -> "Advance" (sic), as can be seen in assoc2.jpg:

index.php/fa/41449/0/

but I can't see a "Composition" attribute in there anywhere so I'm not sure where I'm expected to be looking.

I did see some way of dragging that association onto Class3, where it ended up under the "ownedElement" group (after enabling "Advanced ModelExplorer" (see assoc3.jpg),

index.php/fa/41451/0/

but this all seems phenomenally unintuitive to me. I don't remember all this stuff being as hard as that in Rational Rose, and it's 20 years since I used that.

Thanks again for your help.
  • Attachment: assoc2.png
    (Size: 31.36KB, Downloaded 736 times)
  • Attachment: assoc1.png
    (Size: 19.61KB, Downloaded 886 times)
  • Attachment: assoc3.png
    (Size: 14.41KB, Downloaded 749 times)
Re: Any way to change an element type? [message #1848717 is a reply to message #1848716] Tue, 14 December 2021 21:44 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, John,

I'm sorry, my head hasn't been in Papyrus for a while so I type inaccurately. The Property attribute we're looking for isn't "composition" but rather "aggregation." One of the aggregation kinds is "composite". The others are "shared" and "none":

index.php/fa/41452/0/

Here you see the properties for the two ends of an association.

1. This is the aggregation property of the first end, which is 'composite', indicating a composite association. Edit this to change the association into a shared aggregation or a non-aggregation.
2. The other end is owned by the association, which implies non-navigability by default. Hence the association is "directed" from the composing end to the composed end. But you can change the owned to the classifier here to remove the directed-ness.
3. Alternatively, you can make an association-owned end navigable from the classifier at that end despite that it is not a feature of that classifier. What this means to a language in which you might implement such an association is up to you.
4. Here you can see that on the composite end, the navigability is implied true because the composite end is owned by the classifier, not the association. A classifier-owned end cannot be non-navigable. Setting this false would move the end into the association.

Hope that clears things up a bit.

Christian
Re: Any way to change an element type? [message #1848718 is a reply to message #1848717] Tue, 14 December 2021 22:11 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Hi Christian,

No need to apologise for inaccurate terminology, however, as you should be able to see from the image I added, the "Advance" properties for the association I added by grabbing the little square box with an arrow on it that pops up on a class (tooltip is "Click and drag to create a connection"), then joining it to another class and selecting "association edge" has no member end property controls like you showed. If I choose an "Association" from the "Edges" toolbox, then join the two classes with that, it does have those settings available.

The question, therefore, would be why does the "association edge" from the "click and drag to create a connection" thing (I don't know what the term is for that control in Papyrus) do something totally different to adding an association edge from the toolbox?

I do, however, see these pop up sometimes when I fiddle with those elements.
index.php/fa/41453/0/
  • Attachment: assoc4.png
    (Size: 15.94KB, Downloaded 730 times)

[Updated on: Tue, 14 December 2021 22:14]

Report message to a moderator

Re: Any way to change an element type? [message #1848720 is a reply to message #1848718] Tue, 14 December 2021 22:22 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, John,

I don't know what the "Appearance -> Advance" tab of the property sheet is for. It looks like it just tweaks the visual rendering of the association, which doesn't affect its actual configuration in the model. I don't think you should ever use it.
The "Advanced" (with a 'd') tab at the bottom of the order in the Property Sheet shows the EMF-generated properties UI for the UML model element.

The screenshot I captured was from the "UML" tab (the first tab) of the property sheet for the association (as selected via its edge in the diagram).

If you are referring to the widget that floats near a shape in the diagram that you can drag out to create new incoming or outgoing edges, that's a "connection handle", a kind of modeling assistant (the other kind being the floating toolbar that hovers above a shape in the diagram).

I cannot comment on the mask edit-policy error logs.

HTH,
Christian
Re: Any way to change an element type? [message #1848721 is a reply to message #1848720] Tue, 14 December 2021 22:39 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Thanks Christian. It was the UML tab I should've been referring to. As you can see from this, the properties - > UML tab on an association edge created using the connection handle;

https://www.eclipse.org/forums/index.php/fa/41450/0/

.. there is no sign of any Member End properties.
Re: Any way to change an element type? [message #1848728 is a reply to message #1848721] Wed, 15 December 2021 08:36 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 495
Registered: May 2015
Location: Germany
Senior Member
Hi John,

> there is no sign of any Member End properties.

Yes of course, "memberEnd" properties do NOT belong to an Association element. The "MemberEnd properterties" belong to the Property elements being referenced by the memberEnd association end of the Association element. This is simply because memberEnd is NO attribute but an association end of the Association element (please refer chapter 11.8.1 Association [Class] of the UML 2.5.1 specification for details).

BTW, maybe this thread, which contains a more in depth discussion on associations is of help to you
https://www.eclipse.org/forums/index.php/m/1827159/?srch=memberend#msg_1827159

/Carsten
Re: Any way to change an element type? [message #1848730 is a reply to message #1848728] Wed, 15 December 2021 09:27 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Carsten,

Thanks for that reply. Reading that other thread (which I'd already found through searching) confirms my view that Papyrus is not for me.

Your comments and references don't convince me that the attempt to be compliant with the UML specification requires such compromises on usability so, as I mentioned, I'm abandoning it.

Besides, it's really buggy; I had a class diagram with 4 interfaces realized by one class but, on analysing the .uml file, I could see that the references to the interface elements on two of those realization links were wrong, which seems like a rather fundamental problem.

Re: Any way to change an element type? [message #1848732 is a reply to message #1848728] Wed, 15 December 2021 11:14 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Carsten Pitz wrote on Wed, 15 December 2021 03:36
Hi John,

> there is no sign of any Member End properties.

Yes of course, "memberEnd" properties do NOT belong to an Association element.


This is not accurate. The Papyrus property sheet for Associations surfaces properties of the association ends on the association properties as I showed in my screenshot. This is useful to edit them together in context.

I do not know why they do not appear for John. Bug? Accidental setting of a profile/preference/architecture restriction? It would be interesting to delve into the reason why.

Christian
Re: Any way to change an element type? [message #1848733 is a reply to message #1848732] Wed, 15 December 2021 11:33 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 495
Registered: May 2015
Location: Germany
Senior Member
Hi Christian,
indeed, looking at my 6.0 RC setup I have them together with the Association. I left out the 5.x releases, so my reference were Topcased 2.x up to the Papyrus 4.x releases, that also in my various installations on Windows and Linux behaved exactly as shown by John..
But nevertheless only the references to the memberEnd elements and NOT the memberEnd elements themselves are aggregated within the Association Element belongs ;-)
/Carsten
Re: Any way to change an element type? [message #1848734 is a reply to message #1848733] Wed, 15 December 2021 11:42 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 495
Registered: May 2015
Location: Germany
Senior Member
Hi John,
beside PreeVision by Vector Papyrus is the only Modeling tool (including offerings of Sparx, IBM, PTC and others) I used so far that handles models with more than 300,000 item flows. Lazy loading of submodels works really smooth with Papyrus.
And together with PreeVision and Capella one of the in my experience least buggy. ;-)
/Carsten
Re: Any way to change an element type? [message #1848740 is a reply to message #1848732] Wed, 15 December 2021 17:12 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Christian,

FWIW - I thought I'd knock this screen capture up to show you what I'm doing. This is with the latest nightly build of Papyrus for 64-bit Windows.

Basically you can see most of it in the video file; I've opened the Error Log view for good measure. I create a new, UML project called "Associations" with a class diagram. I add 2 classes (bizarrely "Class2" is the default for the 1st class!) then use the connection handle from Class2 to Class3 and choose to add an Association Edge.

At that point 4 errors show up in the error log - that seems a bit bizarre that some relatively trivial, fundamental (I would've thought) action causes 4 errors!

I choose the association edge that's just been created and, as you can see, there is hardly anything in the UML properties tab. My first thought here is that there's a bug in the connection handle processing whereby it's not creating a 'real' association edge, just some random line. The errors that get logged make me think there is at least one other bug in that processing, although they may be linked.

At this point I mess about a little, then expand the selection in the Model Explorer. As you can see from the video, the "Advanced" button shows that it's toggled on. Clearly it's not as toggling it off does nothing, but toggling it back on again shows multiple new entries in that view; another bug.

However, Carsten talks about member end properties; how you get to them from the association I created in the video is a mystery to me. I've tried clicking on the ends of the association where it attaches to the class, expanded all the entries in the model explorer, but can find no sign of any "member end" that I can choose to see the properties of it.

Note also that more errors have appeared in the error log during this time.

As I mentioned (yesterday), I also found that, with the class diagram I'd drawn, which included one class that realized four interfaces, the "client" field in 2 of the 4 Realization nodes in the .uml file was wrong. I actually spotted this after renaming a copy of the ,uml file, tweaking the xmi header (following some instructions on how to import into Enterprise Architect) and then doing that import. When I put the interfaces and class onto a class diagram in EA only 2 realization links showed up, so I examined the uml file again and found those two errors.

To be honest, I'm shocked that Carsten seems to think Papyrus is not buggy; I've only used it for a few hours and have found a load of what I consider to be bugs in some very basic features, that includes the fact that, in a Sequence Diagram, there are numerous styles not being applied to the elements. E.g. create a sequence diagram, add two lifelines. On both Windows machines I've tried this on, with 3 different versions of Papyrus (2021-09, the latest 6.0.0 as an installed plug-in on Eclipse 2021-12, and on the nightly build) the lifeline boxes at the top just show as flat monochrome, despite the "style" being set to gradient blue etc the same as classes in the class diagram.

Sadly I don't have time for software that is so unintuitive to use, compared to other, similar products I've used over the last 20 years, even if it is "free". I also don't have time to go through reporting, and trying to track updates on bugs when they're in such obvious and relatively essential features; this is at release 6.0.0, if it can't even apply styles properly in a diagram, or have the toggle setting in the model explorer initialised properly, why on earth should I have any confidence that any rigour has gone into the rest of the code.

Thank you, Christian, for your time and patience, but I won't be continuing to attempt to use Papyrus.

*As an aside, the huge image you posted makes this forum do weird things on chrome (at least, the dev version). It renders in such a way that everything's really wide, but there's no scroll bar to move across the way!
Re: Any way to change an element type? [message #1848745 is a reply to message #1848740] Wed, 15 December 2021 20:13 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
BTW - just wanted to apologise if it appears I was ranting at you. You have either more patience than I, or a desire to delve deeper into the UML than any software engineer I've met in over 20 years working with it.
Re: Any way to change an element type? [message #1848763 is a reply to message #1848745] Thu, 16 December 2021 09:56 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 495
Registered: May 2015
Location: Germany
Senior Member
Hi all,
here we see one big advantage of free open source: You are allowed to openly complain about it.
As a user of commercial software you most likely will find some terms in the end user license agreement that demand you to not openly complain ;-)
/Carsten
Re: Any way to change an element type? [message #1848770 is a reply to message #1848763] Thu, 16 December 2021 12:10 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Well, Carsten, in my 34 years as a software engineer, I've never seen any terms of that sort, although there was one time when Green Hills got in touch with me to moan about my criticism of some of the code generated by their AdaMulti compiler.

On the other hand, there is also the disadvantage, in relation to FOSS, of feelings of guilt when complaining about it being 'unusable' (well, for my needs).
Re: Any way to change an element type? [message #1848774 is a reply to message #1848770] Thu, 16 December 2021 13:21 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 495
Registered: May 2015
Location: Germany
Senior Member
Hi John,

to give you an example:

D. Ownership and Restrictions
<maker> retains all ownership and intellectual property rights to the programs and anything developed by <maker> and delivered to
you under this agreement resulting from the services. You may make a sufficient number of copies of each program for your
licensed use and one copy of each program media.
You may not:
• remove or modify any program markings or any notice of <maker>'s proprietary rights;
• make the programs or materials resulting from the services available in any manner to any third party for use in the third
party's business operations (unless such access is expressly permitted for the specific program license or materials from
the services you have acquired);
• cause or permit reverse engineering (unless required by law for interoperability), disassembly or decompilation of the
programs; or
• disclose results of any program benchmark tests without <maker>'s prior written consent.

If you never came around such terms, you might never looked at the EULA.

And by the definition of the <maker>'s legal department
* naming shortcomings
* compare features to compititor's offerings
are benchmarks. And I personally know comanies being sued for naming shortcomings of the <maker>'s offerings.

/Carsten

[Updated on: Thu, 16 December 2021 13:27]

Report message to a moderator

Re: Any way to change an element type? [message #1849467 is a reply to message #1848774] Thu, 20 January 2022 19:43 Go to previous message
Lars Wilmer Thomas is currently offline Lars Wilmer ThomasFriend
Messages: 7
Registered: January 2022
Junior Member
Hey...
Being a buyers delight experienced in modelling from both Rhapsody one EA, I have recently become inclined to see where Papyrus has gotten since we turned down an Ericsson offer to participate in its evolution some three years ago.
And "we" can be about anyone but it so happens it was another Swedish tech company ;)

There. I want to learn...

As for everyone question on choosing association type as none/shared/composite can be achieved by selecting the content of the relationship element in the model viewer. Then it's UML tab will show the options for making the association into (my expected standard relationships) aggregation and composition, respectively
Do not know if this adds clarification? :)

I have, however, struggled to find information on the next level of the problem
- how can I add these preconfigured relations to the toolbox?
- how can I extend the toolbox with my special relations created in a profile stereotype?
Previous Topic:Shorten global appearance operation class diagram
Next Topic:Which Papyrus version for Moka 4.0?
Goto Forum:
  


Current Time: Mon Sep 23 15:59:13 GMT 2024

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

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

Back to the top