Missing multiplicities in UML class diagrams [message #1722279] |
Wed, 03 February 2016 13:02  |
Eclipse User |
|
|
|
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 04:21   |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.26692 seconds