I use EA 12 to simulate a model.
I've created a class with a statemachine, then added a new diagram with an "executable-statemachine" artifact and dragged the class into it as a property.
I would like now to generate the statemachine code.
When I right-click on the artifact, the "code engineering" menu is missing.
Any ideas?
The menu is missing due to the Corporate Edition I used.
Changing the license to Ultimate Edition makes it work!
Related
I am trying to take a copy of the XMI files for an Enterprise Architect model and then import them into a new EA project. The "Bulk Import" option doesn't seem to do what is says on the tin.
By figuring out now the package hierarchy is mapped into the EA xml files I could do this by importing the one file at at time starting from the root package, but this is implausibly time-consuming given the number of files involved. I have tried using the "ImportPackageXMI" method on the API to automate the manual approach, but this requires the parent package GUID to be known. For the root package(s) the parent is a "Model", which is created in the new EAP (maybe it has a GUID - but not that I can figure out) and there seems no simple way of recreating the package hierarchy in any case. (I was hoping that if I imported the xmi files - using a specially created root package - then EA would work out the package structure somehow, but this was not the case!)
This seems like it should be a trivial task that should be directly supported from the tool: export model, then import model. Maybe I'm missing something or there is a simple solution for this?
For clarity, I'm using the Desktop Edition (so no scripting available).
My actual goal was to create a copy of project (EAP) that was not associated with any source control settings : my attempts via export/import of the xml it seems was not the best way to achieve this!
A simple way I have found to is to create a new (project) EAP and then open the original EAP in another window (by clicking on the EAP file in Windows explorer). Once this is done the top level packages from a model in the original can simply be copied and then pasted - using the standard shortcuts - into a model in the new EAP, which is not associated with the original source settings. Hence new source control settings can be applied and the model controlled by a new source control technology.
You could simplify this task by using Project/Data Management/Project Transfer. This way a complete copy is done, which also includes the so-called reference data. XMI does only ex-/import elements and connectors (not for example image data, glossary, etc.).
The right way to do that is firstly create a Controlled Model Branch
Then you can Import this Model Branch and it will reconstruct your complete model (branch) from all the xmi files involved.
I want to create a sequence diagram for some Java code, using Magicdraw. I have Magicdraw Enterprise version installed.
Is there a plug-in I can install, in Eclipse, which can generate a sequence diagram from the code?
Magicdraw Enterprise has this out of the box - there is no need for Eclipse.
I don't have the tool available at the moment, but I will try to explain from memory.
You need to create a Code Engineering Set for Java.
Configure it using the tab named "Select from disk" (or something similar), and select your Java file from disk.
It should detect the class and its content and create a Code Engineering Set.
Unfold the Code Engineering Set, and your class underneath it. Nested under the class will be the different methods (here, I can't remember if it is in the right pane of the configuration menu or, after you close it, in the containment tree).
Now, if you right click on the method, you should have an option to generate the method implementation as a sequence diagram.
I hope this approximate explanation helps. If you need something more step-by-step (for instance, I assumed you know what a Code Engeneering Set is), feel free to ask.
Did you try this yet? http://jdocs.nomagic.com/190/index.html?overview-summary.html (Class: ModelElementsManager --> CreateDiagram()
Magicdraw offers a java API. It is possible to create a sequence diagram programmatically.
You might need to follow these instructions before developing: https://docs.nomagic.com/display/MD185/Development+in+Eclipse
I hope, I was able to help.
i was using netbeans 7.1.2 and it didn't have any UML plug in capabilities and now i have had to resort to netbeans 6.1 and i already have two classes from which i would like to create UML Class diagrams but the reverse engineering option yields no results. I cannot generate any class diagrams. Does anyone know how to utilize the UML plug in to reverse engineer source code and create class diagrams.
This isn't possible anymore I think, I looked for it as well and found nothing but that was a year ago. Something might have happened since.
Check out EIDOS_UML, it's a community effort to recreate the UML capabilities I think, don't know the current status of it.
I hope you have followed the procedure correctly to generate the class diagram:
Right Click the Project (or select the specific packages or java files you want) then select Reverse Engineer option in the right click menu, this will generate model based on the selection. This is a necessary step before creating diagrams.
Then browse the model and select the package (or all the classes) for which you want Class Diagram, right click and select Create Diagram from Selected Elements...
Select diagram type (in this case "Class Diagram"), give a name and click finish.
I have tested it in both Netbeans 6.1 and 6.5, and it works fine.
Hope this solves your problem.
I am about to leave my position and I need to leave documentation for the maintenance of my Java program. The class diagrams I designed at the start of my project are all out of date, to save time I would like to automatically reverse engineer class diagrams. I cannot figure out how to use UMLGraph with Eclipse - I tried LightUML plugin but that error-ed out, with this:
org.eclipse.core.runtime.CoreException: /Users/ctcyu/_EclipseWorkSpace/.metadata/.plugins/org.lightuml.core/build.xml:131: Execute failed: java.io.IOException: Cannot run program "dot" (in directory "/Users/uname/_EclipseWorkSpace/.metadata/.plugins/org.lightuml.core"): error=2, No such file or directory
org.eclipse.core.runtime.CoreException: /Users/ctcyu/_EclipseWorkSpace/.metadata/.plugins/org.lightuml.core/build.xml:131: Execute failed: java.io.IOException: Cannot run program "dot" (in directory "/Users/uname/_EclipseWorkSpace/.metadata/.plugins/org.lightuml.core"): error=2, No such file or directory
I see that the program "dot" is in the Graphviz package required by UMLGraph. Since I am using MacOSX, I downloaded Graphviz's Mac package. It installs a Graphviz.app, I can't find any "dot" binaries anywhere. If I compile from source will there be binaries for the "dot" tool?
If I don't use LightUML, and typed in the absolute path to UMLGraph.jar in the "Generate Javadoc" tool in Eclipse, I get this error:
javadoc: error - Cannot find doclet class UMLGraph
1 error
How do you specify custom doclets in Eclipse? Or, how do I get LightUML to work? I am using Eclipse Helios.
I left my previous company few weeks ago and must admit that they are very happy with my consulting. My project documentation is based on UML class diagrams mainly with few other diagrams.
I used a tool from a company named O....o EclipseUML to reverse my full java project into UML. It has reversed no only the code but also all my java persistence annotations.
Once I reversed my project in order to get my UML model then I have created views from my project by drag abd drop of classes and interfaces into empty class diagrams. I have finaly let many comments directly into the diagrams as note (e.g. yellow) and also left java doc visible in some diagrams as a note.
finaly I left the code with a full model attached to it and about 50 class diagrams. I did not have generated a paper documentation but if you open your project with Eclipse Helios then you have a the root of each package the related class diagrams including my notes. If you click on a class in one of the diagrams then you can see my comments written directly in the model. etc...
I would say that my documentation is live synchronized with the code now and it will be very easy for a new developer to understand the full project in just few hours by navigating inside the code and looking UML explanation by a double click.
I think that paper documentation is useless because you never understand the full scope of the project. I believe that my project using UML mixed with the project and synchronized with the code is a lot more powerful.
Hope this help
I install Papyrus at here. So how to generate code using Papyrus ?
To generate the java code from UML you can follow the below steps.
New Project->EMF Project Press Next
give the project name
In Model Importer page select UML model and press Next
Select UML model which is created by using Papyrus.Press next
In Package selection page select all the root packages
click finish, it will generate genmodel.
Use the genmodel to generate Java code.
I hope this information helps.
In order to generate any text artifacts from UML models in the Eclipse Modelling Environment (i.e. Papyrus, TopCased, etc.) you should use Acceleo which is an eclipse implementation of the MOF models to text transformation language, the OMG standard language for models to text transformations.
It is a very well made technology but it could take some time to become familiar with it especially if you do not know MOF and the Model Driven Architecture.
QVT is another OMG language but its aim is models to models transformations (not models to text). It is therefore not the right answer to your question.
These can help you.
Papyrus Tutorials
Papyrus is an Eclipse lugin for modeling, you need to use additional Eclipse plugin to do model transformations. In the other answer you can find link to tutorials. First of them indicates you should use QVTo.
Resources:
http://wiki.eclipse.org/M2M/Operational_QVT_Language_%28QVTO%29
http://www.eclipse.org/m2m/qvto/doc
http://www.eclipse.org/modeling/m2m/downloads/index.php?project=qvtoml
To generate code from a UML diagram created with Papyrus must create a run configuration for Papyrus.
More information and a demo video at the following links.
http://www.papyrusuml.org/scripts/home/publigen/content/templates/show.asp?P=140&L=EN
http://www.papyrusuml.org/home/liblocal/docs/Documentation/Java-Code-Gen/Papyrus-GenJava-GenerateCode.swf
You need to install Papyrus Java Classes Generator.
Help --> install new software
work with : http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/mars
Check group items by category
Check show only the latest version of available software
Check Papyrus Java
Next --> accept terms and conditions
finish
Now, in your model.di : right click on your class --> Java --> Generate java code.
And you're done !
It doesn't work with Java because even if you get a code from a class diagram then this code is so dirty that it is totally unusable.
It seems that this tool has been written by modelers who have never done any java codding :-)