Thursday, August 1, 2013

importing UML models from Modelio to Papyrus

Skipping the discussion of class diagrams, UML and round trip engineering, let's just say after dismissing Umlet and Violet, Argo, NClass and StarUML, and all of the non-Windows or commercial offerings you have settled between Modelio and Papyrus. You like the ease of Modelio, but its freemium service means you can't generate code, and Papyrus + Acceleo does just that.
  1. Make your diagram in Medelio
  2. From the model explorer, right click and select XMI --> export
  3. Browse to a location outside of your workspace and save it with the EMF UML 3.0.0, but unclick adding Modelio notations please! Also save it with the *.uml extension instead *.xmi.
  4. Now start eclipse and show the Papyrus perspective.
  5. if you already have a project, that's fine, just start a new Papyrus model.
  6. Create a folder in your project called XMI and import the files you exported from Modelio - there should be 2 of them, a profile and your model.
  7. Double click the model that you just created (e.g. model.di) and it should open in the main window, and hopefully you will see it in the model explorer too.
  8. Right click and select import, then import package from user model.
  9. In the window that opens, select your profile and model packages, and then import all. I'm not 100% positive that you need to import the profile, but it doesn't hurt, and I had issues when I tried to just copy the model components from the Modelio UML model to Papyrus.
  10. Ta-daa, you should now see two packages in your model explorer one is the default profile and the other is your Modelio model.
  11. Now at the top level model, create a class diagram (or any of the 9 UML diagrams). This is the most important step!
  12. Drag and drop the first class into the diagram window.
  13. Expand that class in the model explorer and select the class attributes and drag and drop them into the first section of the class below the title.
  14. Repeat for the operations, but drop them into the second box.
  15. Drag over any associations.
  16. You may need to remove and re-add any stereotypes as for some reason they were not showing up in the diagram.
Voila! you've transferred your model and your diagram!

No comments:

Post a Comment

Fork me on GitHub