History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: UMLMETA-28
Type: New Feature New Feature
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Wouter Zoons
Reporter: Cédric Vidal
Votes: (View)
Watchers: (View)
Operations

If you were logged in you would be able to see more operations.
UML Metafacades

MagicDraw not generating UML:AssociationClass information workaround proposition

Created: 04/Apr/05 06:28 PM   Updated: 28/Apr/08 03:58 PM
Component/s: None
Affects Version/s: 3.0 RC1
Fix Version/s: None

File Attachments: 1. XML File Identity.xsl (2 kb)
2. XML File MagicDrawAssociationClassNormalizer.xsl (4 kb)

Environment: MagicDraw 9, UML 1.4, XMI 1.2, XSLT 1.0
Issue Links:
Related
This issue relates to:
CORE-56 Add a n XSLT transformation pipeline Major Closed
 


 Description   
The UML 1.4 model allows you to create a class for representing an existing association (in the visualization it is a dashed line between the association and the related class) which in XMI 1.2 must be generated as a matching UML:AssociationClass meta information (Poseidon does that well though it does not allow association classes to be specialized).

MagicDraw allows you to draw the forementionned dashed line in a diagram, but it does not generate properly the matching UML:AssociationClass meta informations in any of its XMI outputs. The association class is generated as a normal UML:Class and the dashed line diagram information is only generated using the XMI.extensions mecanism.

The MagicDraw generated XMI lacking UML:AssociationClass meta informations, AndroMDA has no way to know that there is actually an association class. So here is a XSLT stylesheet that takes as input a MagicDraw generated XMI 1.2 file, fetches the graphical dashed line information, the participating UML:Class and UML:Association and merges them into a UML:AssociationClass generating a XMI file that AndroMDA can understand.

Known limitations:
- as the information used as input is partly graphical, the diagrams must be thought with care.
- if two distinct diagrams draw a dashed line between a given association and a given class, the XSLT behavior is unknown: so draw only one diagram with the dashed line to be sure. Support for duplicates removal might be added in the future.
- this is a hack, proper UML:AssociationClass support seems to be scheduled for MagicDraw 10.
- don't even try to load the resulting XMI file in any UML Editor, it is likely to fail, the resulting XMI is only meant to be loaded by AndroMDA. A sufficient evidence is that the XSLT creates a UML:AssociationClass out of a UML:Class and a UML:Association, so the fact that the UML:Class was actually a UML:Class is lost in the output.
- consider the XSLT output only as an temporary file fed to AndroMDA.


 All   Comments   Change History      Sort Order:
Comment by Cédric Vidal [04/Apr/05 06:29 PM]
The main XSLT.

Comment by Cédric Vidal [04/Apr/05 06:30 PM]
An identity XSLT imported by MagicDrawAssociationClassNormalizer.xsl

Comment by Wouter Zoons [04/Apr/05 07:59 PM]
thanks for sharing this with us, very clever solution

do you have any idea how this could be integrated best with AndroMDA ? or would we simply point users to this issue if they want to make it work for them ?

Comment by Chad Brandon [04/Apr/05 08:08 PM]
We could set up a pipeline in the core or something for things like this (for when people want to transform the XMI with XSLT docs or something, since it's happened more than once), we just create an option that allows people to specify these XSLT documents (and the order in which they should be applied) and we apply them to XMI before its loaded by MDR...what do you think?

Comment by Wouter Zoons [04/Apr/05 08:27 PM]
yeah sounds good, but the pipeline should not alter the original XMI, it should just feed a transformed one to AndroMDA

this would be excellent to have in the core

Comment by Chad Brandon [04/Apr/05 08:30 PM]
Yeah that's what I meant...it just modifies the XMI in memory, not on disk before the repository loads it...I'll create an issue.

Comment by Wouter Zoons [04/Apr/05 11:20 PM]
this issue is now followed-up by issue CORE-56

Comment by Cédric Vidal [05/Apr/05 12:05 AM]
Thanx for the compliment, this was the least I could do in return for the valuable feedback you gave to me :)

As for the integration to AndroMDA, I'm not sure, on the one hand, it is a hack related to a specific limitation of a specific vendor's tool, but on the other hand, MagicDraw is the tool of choice to use with AndroMDA and except for that limitation a really great modeling tool worth the care.

As far as I'm concerned, I included this XSLT as an ant:style based goal in a XMI specific maven plugin (whose main purpose is to manage xmi.zip type artifacts like maven-jar-plugin does). Maybe, this could be the way to go for AndroMDA too. I can share that plugin with you if you're interested. What's more, I believe this would be a usefull addition to the andromda maven plugins ;)

There is also CORE-56, which is a great idea. In that paradygm, the hack could be available as an optional pipeline transformer, that the user could include in the pipeline if he wants to.