function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BomanBoman 

Eclipse plugin to reverse engineer Apex to UML?

I've inherited a large Apex project, 10s of KLOC. I don't think any UML diagrams for this exist. For my own clear understanding of what's happening in this code I am looking for an Eclipse plugin (preferably FREE) that supports generating UML from my Apex code. Any suggestions? Have you tried any of the similar plugins for Java RE? Were they accurate? Thanks.

 

--Boman.

Best Answer chosen by Admin (Salesforce Developers) 
GunishGunish

I think I have a solution for this now.

 

There isnt a tool avaibale directly to do this. So I did the following.

 

1. Found an Open Source Free tool to convert Java code to UML. : ESS Model

here is the link http://essmodel.sourceforge.net/index.html

 

2. Copied the .class files from /src folder of my workspace to a new localtion 

3. Renamed all the .cls files to .java files.

For those who were not born while DOS was the Coolest Operation System around: type ren *.cls *.java in your dos prompt.

 

4. Ran the tool (ESS Model) and Chose File > Open Folder to the new Folder.

5. Worked like a charm!

 

since this is open source, it would ne nice to see someone redesign to use force.com files.

 

All Answers

GleyveGleyve

I need to do the same. Do you have a solution already? Does anybody has a solution? Thanks.

socialcloudtechsocialcloudtech

Any news about it?

I need the same thing  :-(

 

GunishGunish

I think I have a solution for this now.

 

There isnt a tool avaibale directly to do this. So I did the following.

 

1. Found an Open Source Free tool to convert Java code to UML. : ESS Model

here is the link http://essmodel.sourceforge.net/index.html

 

2. Copied the .class files from /src folder of my workspace to a new localtion 

3. Renamed all the .cls files to .java files.

For those who were not born while DOS was the Coolest Operation System around: type ren *.cls *.java in your dos prompt.

 

4. Ran the tool (ESS Model) and Chose File > Open Folder to the new Folder.

5. Worked like a charm!

 

since this is open source, it would ne nice to see someone redesign to use force.com files.

 

This was selected as the best answer
socialcloudtechsocialcloudtech

Hi Gunish,

i tried your tutorial but it works very bad........

I'm trying a similar way but with different tools.

If i will found a good workaround (waiting a tool provided by SFDC) i will be happy to share the solution with the community.

 

Francesco

GunishGunish

Francesco,

 

Can you share what was the issue that you faced while following the steps above, so that I can understand the problem you had and find a workaround ?

 

-Gunish


socialcloudtechsocialcloudtech

Hi Gunish,

the problem is that all the System.debug and other stuff are considered as methods of Apex Classes.

Thank you for supporting.

 

Francesco

 

GunishGunish

Hi Francesco,

 

My take would be that the tool is doing exactly what is it supposed to do, in Identifying System.Debug as a call out.

 

In traditional Programming (Java , C, .NET) call outs can be made to 'Static Global' methods.

Force.com has a set of these static global methods which are available to us as a Library in the System class.

 

Consider the scenario where you wrote your own static class and called a method from a another class. We would expect to see the method appear as a call out in Force.com

 

One of the options you have is,

You can clean up ur code, remove / comment the system debug calls and then generate a UML and revert back the Debug Statements after you have what you want ?

 

Easy way to do this is, go a Project Wide search in Eclipse, CTRL + H  or "Search > Search" depending on which version of eclipse you use and replace all 'System.Debug' with '//System.Debug' and revert back later.

 

Let me know if that helps.

 

Do note, that this tool is not a Force.com supported tool and neither is it ment to parse force.com in the way we expect. This is a workaround i.e. closest / easiest way to get what we want.

 

Overall, I dont think the solution is 'very bad'. :-)

 

-Gunish


SamuelDeRyckeSamuelDeRycke

Gunish, your post helped me out too!  I was hoping to see more info on the schema, but this is already a nice visual representation of all classes, in less than a few minutes of work. Thanks

SabrentSabrent

Gunish thanks for your workaround.  Much appreciated!!

I have been searching for ways to reverse engineer Apex to UML without much success, Will try your workaround.