Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Missing multiplicities in UML class diagrams
Missing multiplicities in UML class diagrams [message #1722279] Wed, 03 February 2016 18:02 Go to next message
Lutz Wrage is currently offline Lutz WrageFriend
Messages: 181
Registered: July 2009
Senior Member
I have UML class diagrams that were originally created using the Topcased UML editor. I have converted the diagrams to papyrus using a built-in operation of the last Topcased release.
When I open the diagrams using papyrus 1.1.x on eclipse Mars, the diagrams are ok except that the association ends have no multiplicities displayed. The multiplicities are not just hidden: When I open the label manager for one of the migrated associations, it only offers SourceRole, Stereotype, and TargetRole. For a newly added association there are additional entries Name, SourceMultiplicity, and TargetMultiplicity.
It seems there is something missing in the *.notation files, but I wasn't able to figure out what. Is there a way to fix the diagrams?
Re: Missing multiplicities in UML class diagrams [message #1722352 is a reply to message #1722279] Thu, 04 February 2016 09:21 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

Quote:
It seems there is something missing in the *.notation files, but I wasn't able to figure out what. Is there a way to fix the diagrams?


Papyrus unfortunately doesn't provide a "repair diagrams" feature. The only workaround I can suggest is displaying the multiplicity in the "sourceRole" label (sourceRole and sourceMultiplicity are actually both able to display all the possible information about member ends, so it's just a matter of customization)

This can be done by using the following Stylesheet (CSS) rule:

Association > Label:sourceRole,
Association > Label:targetRole {
    maskLabel: visibility name multiplicity derived;
}


Another option would be to remove all your associations and drop them again in the diagram... This would fix the diagram, but requires more effort...

A model-to-model transformation to add the missing labels to all your diagrams might also work. The transformation would look like this:

- Find all notation::Connector with type = "4001" owned by a notation::Diagram with type = "PapyrusUMLClassDiagram"
- For each, add two new notation::DecorationNode as children
- The first DecorationNode should have type="6033", the other one type="6034"
- For each of these DecorationNode, add a layoutConstraint (notation::Location). The 6033 one should have y=20 (Above the association), and the 6034 y=-20 (Under the association). x doesn't need to be set

HTH,
Camille


Camille Letavernier
Re: Missing multiplicities in UML class diagrams [message #1722536 is a reply to message #1722352] Fri, 05 February 2016 14:01 Go to previous message
Lutz Wrage is currently offline Lutz WrageFriend
Messages: 181
Registered: July 2009
Senior Member
Thanks, an ATL model-to-model transformation did the trick.
Previous Topic:How to show edges in the outline
Next Topic:Auto size for class rectangle
Goto Forum:
  


Current Time: Fri Mar 29 10:21:34 GMT 2024

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

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

Back to the top