Data Model Diagram
info
We are currently in the process of migrating from PlantUML to Mermaid for our diagram generation. This will remove the external dependency on PlantUML and offer a better user experience. Diagram generation with Mermaid is currently supported for integration diagrams and sequence diagrams only. For more details, check out sysl diagram.
info
This command requires the SYSL_PLANTUML environment variable to be set or passed in as a flag. Follow the instructions here for more details.
sysl datamodel generates data model diagrams for types defined in Sysl.
Usage#
usage: sysl datamodel [<flags>] <MODULE>Output Formats#
The output file format can be specified via the extension of the filename passed into the -o flag.
Valid extensions include .svg, .png, .uml, .puml, .plantuml, .html or .link.
Required Flags#
Either the project flag or the direct flag must be passed in. The direct flag generates data model diagrams for ALL types defined in the input Sysl file. The project flag specifies a subset of applications to generate diagrams for. Refer to the Project Datamodel Diagram example for more info.
-j, --project=PROJECTGenerate diagrams only for applications specified in the specified project-d, --directGenerate diagrams for all applications and types
Optional Flags#
All flags are all optional.
Optional flags:
--class_format="%(classname)"- ` Specify the format string for data diagram participants. May include %%(appname) and %%(@foo) for attribute foo (default: %(classname))
-t, --title=TITLEDiagram title-p, --plantuml=PLANTUMLbase url of PlantUML server (default:SYSL_PLANTUMLorhttp://localhost:8080/plantumlsee http://plantuml.com/server.html#install for more info)-o, --output="%(epname).png"Output file (default: %(epname).png)-f, --filter=FILTEROnly generate diagrams whose names match a pattern
Arguments#
Args:
<MODULE>Input sysl file that contains the system specifications. e.gsimple.sysl. The.syslfile type is optional.
Examples#
Simple Datamodel Diagram#
sysl datamodel -d CardInfo.sysl -o CardInfo.svgPayment: !type CardInfo: credit_card_number <: string: @sensitive="true" type <: stringCompound Datamodel Diagram#
sysl datamodel -d Payment.sysl -o Payment.svgPayment: !type CardInfo: credit_card_number <: string: @sensitive="true" type <: string !type Payment: CardInfo <: CardInfo Amount <: intProject Datamodel Diagram#
sysl datamodel -j Project Payment.sysl -o "%(epname).svg"In this example we generate two diagrams using the -j flag to specify which applications to display
Payment: !type CardInfo: credit_card_number <: string: @sensitive="true" type <: string !type Payment: CardInfo <: CardInfo Amount <: int
PaymentService: !type PaymentProvider: Provider <: string
Project: PaymentService: PaymentService Payment: Payment
This diagram only shows the types within the Payment application
This diagram only shows the types within the PaymentService application