2

I have PlantUML code:

@startuml
hide methods
hide stereotypes

!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
!define Enum(name,desc) class name as "desc" << (E,#FFFFAA) >>
!define primary_key(x) <b>x</b>
!define not_null(x) <u>x</u>
!define unique(x) <color:green>x</color>

Enum(menuitemtype,"Menu item types") {
    category
    text
    sticker
    user_action
}

Table(menuitem,"Menu item") {
    primary_key(id) INTEGER
    not_null(unique(name)) VARCHAR[32]
    type INTEGER
    anonymous BOOLEAN
    parent INTEGER
    type INTEGER
}

Table(chat,"Telegramm chats") {
    primary_key(id) INTEGER
    not_null(unique(chat_id)) INTEGER
    is_group BOOLEAN
}

Table(requester,"Bot requester") {
    primary_key(id) INTEGER
    not_null(unique(tele_id)) INTEGER
    is_boot BOOLEAN
    user_name VARCHAR[32]
    last_name VARCHAR[32]
    first_name VARCHAR[32]
    is_active BOOLEAN
    last_access DATETIME
}

menuitem -- menuitemtype
menuitem "0..N" --> "1" menuitem
requester "1" --> "N" chat

@enduml

I take a code from here: https://gist.github.com/QuantumGhost/0955a45383a0b6c0bc24f9654b3cb561

When NetBeans' PlantUML plugin actually displays the structure:

enter image description here

The java tool /usr/share/plantuml/plantuml.jar installed on Ubuntu 16 with apt-get gives follow error:

$ cat SystemDB/schema.puml | plantuml -syntax -v
(0.000 - 119 Mo) 117 Mo - PlantUML Version 8024
(0.048 - 119 Mo) 115 Mo - GraphicsEnvironment.isHeadless() false
ERROR
5
Syntax Error?

and generates follow file

enter image description here

I see that stereotypes are convenience according to: http://plantuml.com/PlantUML_Language_Reference_Guide.pdf - chapter 1.21

Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111
Olga Pshenichnikova
  • 1,509
  • 4
  • 22
  • 47

1 Answers1

0

On Ubuntu, apt-get installs a (sometimes very) old version of PlantUML, and that's why there are syntax errors.

You can see how to install it using a script, or follow that script to install it by hand. Once you install it that way, you can updated it by downloading the latest .jar file from PlantUML.com.

Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111