Umple Diagram Generator
Supported diagram types
| Type | language value | Read first |
| ------------- | ----------------------------- | ---------------------------------------- |
| Class diagram | classDiagram | references/class-diagram-syntax.md |
| State machine | stateDiagram | references/state-machine-syntax.md |
| ER diagram | entityRelationshipDiagram | references/class-diagram-syntax.md |
| Trait diagram | traitDiagram | references/class-diagram-syntax.md |
Workflow
- Read the syntax reference for the requested diagram type.
- Write valid Umple code.
- Call the Umple Online API (see below).
- Extract SVG from the response and save to a
.svgfile. - On error, read the message, fix the code, retry (up to 3 times).
- Render the SVG inline for the user.
API
Endpoint: POST https://cruise.umple.org/umpleonline/scripts/compiler.php
Content-Type: application/x-www-form-urlencoded
| Parameter | Value |
| --------------- | -------------------------------------------------------------- |
| language | See table above |
| languageStyle | diagramUpdate |
| umpleCode | The Umple source code |
| filename | model.ump |
Use whatever HTTP tool is available (WebFetch, curl, fetch, etc.).
Response parsing
Success: response contains two nested <svg> tags. Extract the inner SVG — the one with a viewBox attribute. Clean up any xlink:href="javascript:..." attributes.
Error: response contains <span class="umple-message-error">. Strip HTML tags to read the error.
Output
- State the diagram type.
- Show the Umple source in an
umplecode block. - Render the SVG visually.
- Save files:
<name>/model.umpand<name>/diagram.svg.
Guardrails
- Always read the syntax reference before writing Umple code.
- Prefer a smaller valid model over guessing syntax.
- One association per class pair — never define the same relationship from both sides.
- Never use
Finalas a custom state name — it is a reserved keyword in Umple. UseDone,Completed, etc. instead.