Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating UML diagrams from textual representation

Tags:

linux

uml

How can I generate a UML sequence diagram from a file containing a textual representation of my process, with command-line tools in Linux?

like image 206
user336639 Avatar asked May 09 '10 13:05

user336639


People also ask

Can Visio draw UML?

To begin your UML diagram in Visio, you need to launch the tool on your device and go to the 'New' option of the file. You should select the UML diagram and choose between the metric or US units. Create the Diagram: Click on the Create option.


3 Answers

Although PlantUML is listed in the accepted answer (among many other tools) it merits more attention.

In addition to being easily wrapped into a command line tool, PlantUML also has

  1. excellent documentation (check out the docs for sequence diagrams)
  2. simple and powerful syntax (may compare favorably with UMLGraph)
  3. styleable output
  4. extensive tool integration (Emacs, Sphinx)

However PlantUML comes as a java archive so the following setup may be required:

  1. java
  2. graphviz (not required for sequence diagrams)
  3. a bash wrapper

java and graphviz are available as packages for the major linux distros. PlantUML itself is available for Fedora and Ubuntu.

If your distribution does not provide a package, download a jar file from the main site and wrap as a bash script.

A bash wrapper (as follows) can be stored in a file named plantuml on your path i.e. one of the directories listed by echo $PATH. Don't forget to make it executable with chmod u+x plantuml.

#!/bin/bash
# from the vim syntax plugin README at aklt/plantuml-syntax on github
java -jar $HOME/path/to/plantuml.jar -tsvg $@

Then run plantuml apple.uml berry.uml and plantuml will create apple.svg berry.svg.

like image 189
Salticus Avatar answered Nov 12 '22 17:11

Salticus


There are many (many=more than 10) tools for this.
See a complete list.

like image 6
Jordi Cabot Avatar answered Nov 12 '22 19:11

Jordi Cabot


Not sure if it's what you want, but UMLGraph can generate sequence diagrams using graphviz and ghostscript...

like image 2
jcayzac Avatar answered Nov 12 '22 17:11

jcayzac