Especificação
Na specification, você define sua notação.
Tipo de elemento
Seção intitulada “Tipo de elemento”Define os tipos de elementos usados no modelo:
specification { // Define whatever you want element user element cloud element system element application element component element controller element microservice element queue element restapi element graphqlMutation element repository element database element pgTable}Mais adiante, você verá que tipos de elementos podem ter propriedades e definir estilos:
specification { element queue { title 'Kafka' description 'Kafka queue' technology 'kafka topic' notation 'Kafka Topic' style { shape queue } }}Relacionamento
Seção intitulada “Relacionamento”Tipos de relacionamento podem definir tags, propriedades (title, description, technology, notation, links) e estilos visuais:
specification { relationship async { #tcp title 'Asynchronous' description 'Communication over a message broker' technology 'Kafka' notation 'Async' link https://example.com/async multiple true line dotted color amber } relationship subscribes relationship is-downstream-of
tag tcp}Essas propriedades são herdadas por todo relacionamento desse tipo, a menos que o relacionamento as sobrescreva (tags são combinadas):
model { // inherits the title and style defined for the 'async' kind ui .async backend
// overrides the title, keeps the inherited style ui .async db 'reads from'}Mais em relacionamentos.
Tags podem ser usadas para marcar, agrupar ou filtrar elementos/relacionamentos/visões, ou para adicionar semântica extra, como #deprecated, #epic-123 ou #team2.
specification { tag deprecated tag epic-123 tag team2}Você pode atribuir cores:
specification { tag deprecated { color gray }
tag team2 { color #AABBCC // or using rgb/rgba (see below) }}Você pode adicionar tags aos tipos de elementos:
specification { // Now every kafka-topic will be marked with the infra and data-lake tags element kafka-topic { #infra #data-lake } tag infra tag data-lake}Cores personalizadas podem ser definidas para estender os temas integrados. Depois de definidas na especificação, elas podem ser usadas junto com as cores do tema.
specification { color custom-color1 #F00 color custom-color2 #AABBCC color custom-color3 rgb(255, 0, 0) color custom-color4 rgb(100 150 200) color custom-color5 rgba(44, 8, 128, 0.9) color custom-color6 rgba(255, 200, 100, 50%)
element person { style { color custom-color1 } }}