Documentation via PlantUML

So… sometimes you just need to create a really quick flowchart, or relationship diagram, and you don’t really want to “draw” it… When I DO want to draw, I typically use https://app.diagrams.net/ (formerly Draw.IO).
But, if I want to have the drawing something that is more dynamic, and can change, I now use a combination of Markdown language (for the text) and then PlantUML for the diagram. Reason is that PlantUML allows you to describe the diagram in text form, and then PlantUML will do the drawing from there…
Example, Here is a “complex” drawing (simplified from a previous discussion on ABC Codes) that takes 15 text lines, and you get the resulting drawing automatically.
There is tons of documentation on PlantUML at https://www.planttext.com/ and (click here for PDF Guide)
below is the text and image generated. You can control the way that boxes are connected, whether they are vertical or horizontal, and all sorts of secret things.

@startuml
    part ..{ partPlant
    partPlant ..{ plantWhse
    partPlant --> plant
    plantWhse ..{ partWhse
    partWhse ..{ partBinInfo
    partBinInfo .{ partBin
    partCost <-- partPlant
    partCost <-- plant
    partLot <-- partBin
    warehouse <-- plantWhse
    warehouse <-- partWhse
    warehouse --> plant
    plantWhse --> plant
@enduml

image

Here is a more detailed drawing I made (referenced earlier)…

@startuml

hide circle

' avoid problems with angled crows feet
skinparam linetype ortho

entity "Part" as part {
    *INDEX: Company, Part
    --
    costing method
}

entity "Plant" as plant {
    *INDEX: Company, Plant
    --
    *PlantCostID
}
entity "Warehouse" as warehouse {
    *INDEX: Company, Warehouse
    --
    * Plant
    *ABCOCode Rules
}

entity "PartPlant" as partPlant {
    *INDEX: Company, Part, Plant
    --
    *CostID
}
entity "PlantWhse" as plantWhse {
    *INDEX: Company, Part, Plant, Whse
    --
    *PrimBin
}

entity "PartWhse" as partWhse {
    *INDEX: Company, Part, Whse
    --
    Data Available:
    * total Onhand by warehouse
    * totalAllocations by warehouse
}

entity "PartBin" as partBin {
    *INDEX: Company, Part, Whse, Bin, Lot
    --
    Data Available:
    * Onhand by warehouse/bin/Lot
    * Allocations
}

entity "PartBinInfo" as partBinInfo {
    *INDEX: Company, Part, Whse, Bin
    --
    Data available:
    * total onhand at the Warehouse/Bin (summarized)
    * Min/max for kanbans
}
entity "PartCost" as partCost {
    *INDEX: Company, Part, CostID
}

entity "PartLot" as partLot {
    *INDEX: Company, Part, LotNum
    --
    Onhand
    Cost (if lot costing)
}

part .{ partPlant
partPlant ..{ plantWhse
partPlant --> plant
plantWhse ..{ partWhse
partWhse ..{ partBinInfo
partBinInfo .{ partBin
partCost <-- partPlant
partCost <-- plant
partLot <-- partBin
warehouse <- plantWhse
warehouse <-- partWhse
'warehouse <-- partBinInfo
warehouse --> plant
plantWhse --> plant


@enduml

3 Likes