check Best set up to work in Modelio and Eclipse (Round Trip) at the same time?

4 years 3 months ago - 4 years 3 months ago #4931 by cononda
I wonder if anyone can share his experience or give some tips on how to best get Modelio and Eclipse working together using the Round Trip functionality (Auto synchronization of UML Models and .java file code). Especially on how to set up the projects folder and what to look out for or how to synchronize the class files (.java).

I tried to find some explanation online but could not find much on this topic.

This is how I do it now:
  1. Create new java project in Modelio
  2. model classes with attributes, constructors and methods
  3. create java files via package, select Java Designer > gerenate
  4. create new project in Eclipse, set custom path to location of Modelio project
  5. switch to Eclipse, write code for existing Methods and constructors, save files
  6. switch to modelio, update, select package > Java Designer > update model from source
  7. add new classes, attributes, constructors and methods
  8. overwrite java files via package, select Java Designer > gerenate
  9. repeat from 5.

I am trying this out by myself now. But I wonder if I do it right. How are you doing it? Any thoughts, remarks, and tips are welcome.

Update: Added improved workflow below...

Please Log in or Create an account to join the conversation.

4 years 3 months ago #4932 by chm
Hi cononda,

as far as I can tell, what you're doing is perfectly appropriate. :)

I still have two remarks:

set custom path to location of Modelio project


It is also possible to set Java Designer's generation path to be the same as your eclipse project.

Go to the "Configuration / Modules..." menu entry, select the Java Designer module and edit the "Directories / Code generation path" parameter.

switch to modelio, update, select package > Java Designer > update model from source


Update model from a package works fine, but it is also possible to update a specific class/interface.
Better yet, generating a bunch of elements in Modelio after modifications have been made to specific java files should ask if you want to update the model from sources or overwrite the changes. It can help a lot when you don't remember precisely which classes have been edited.

Hope this helps,


chm
The following user(s) said Thank You: cononda

Please Log in or Create an account to join the conversation.

4 years 3 months ago #4942 by cononda
Hi chm,

It is also possible to set Java Designer's generation path to be the same as your eclipse project.


:up

Great I already adapted my workflow!

Update model from a package works fine, but it is also possible to update a specific class/interface.
Better yet, generating a bunch of elements in Modelio after modifications have been made to specific java files should ask if you want to update the model from sources or overwrite the changes. It can help a lot when you don't remember precisely which classes have been edited.


Thanks for writing this down so understandable. I struggled with this one a bit. Now it is clear.

Please Log in or Create an account to join the conversation.

4 years 3 months ago - 4 years 3 months ago #4948 by cononda
I just wanted to share my updated workflow:

  1. create a new java project in Modelio
  2. create a new java packet in Modelio, under the project name standard package (this will be the packet shown under src > yourNewPacket in Eclipse)
  3. model classes with attributes, constructors, and methods in Modelio
  4. create a new java project in Eclipse
  5. set Modelio Java Designer's generation path to be the same as your Eclipse project src folder. Menu Configuration > Modules > Java Designer > Directories > Code generation path
  6. create java files via package, select Java Designer > generate (regardless of generation from class or package, since the package is not yet existing in Eclipse it will be generated as well)
  7. in Eclipse add javadesigner.jar, Menu Project > Properties > Java Build Path > Libraries > add external JARs add javadesigner.jar (~\.modelio\3.7\modules\JavaDesigner_3.7.01\JavaDesigner\bin\javadesigner.jar 'To be able to compile outside Modelio, you must add this archive. If you generate the ANT file from Modelio, the Jar archive is added automatically.'
  8. in Eclipse, Refresh project (F5), write code for existing Methods and constructors, save files
  9. switch to Modelio, update, select package > Java Designer > update model from source
  10. add new classes, attributes, constructors and methods
  11. overwrite java files via package, select Java Designer > generate
  12. repeat from 8.

Btw. I still find the update model from source (step 9.) useful. Because when I add new attributes to the class (in Modelio after writing code in Eclipse) and then want to generate the .java file, it will ask me if I want to update from source. But if I say yes, I will then lose the changes made in Modelio (the new attributes).

Please Log in or Create an account to join the conversation.

Moderators: tma
Time to create page: 0.038 seconds
^ Back to Top