@@ -88,22 +88,26 @@ you can name these in a `pumla_blacklist.txt` file. You can also have comments i
8888blacklist file using ` # ` as first character of the line. But comments must be
8989standalone lines, you cannot put a comment behind a path or filename.
9090The .puml files found will be parsed
91- and if they are pumla files, their relevant content will be extracted and stored in the
91+ and if they are pumla architecture files, their relevant content will be extracted and stored in the
9292` modelrepo_json.puml ` file or the given
93- filename. Each call will overwrite the existing ` modelrepo_json.puml `
93+ filename. For docs-as-code requirements files, the relevant content will be extracted and stored in the
94+ ` reqsrepo_json.puml ` file.
95+ Each call will overwrite the existing ` modelrepo_json.puml ` and ` reqsrepo_json.puml `
9496file, therefore they should not be modified by hand,
9597because changes will get lost. These repository files are the basis for the
9698PlantUML extension macros. The macros help to get data out of these repositories
9799and thereby re-use the once defined model elements and diagrams in a structured
98100way.
99101
100- The generated ` modelrepo_json.puml ` should also not be checked-in into a version
102+ The generated ` modelrepo_json.puml ` as well as the ` reqsrepo_json.puml `
103+ should also not be checked-in into a version
101104control system, as it contains absolute paths that are different on every computer
102105where the source code is checked out. Therefore, after a fresh checkout/clone of
103106a source code repository, first thing to do is call ` pumla init ` to create a link
104107to the pumla macros to access the model repository JSON database, the second
105108thing to do is call ` pumla update ` to scan the source code repository for pumla
106- files and create the ` modelrepo_json.puml ` file. After that you can use the
109+ files and create the ` modelrepo_json.puml ` and ` reqsrepo_json.puml ` file.
110+ After that you can use the
107111model repository to create diagrams and are able to use all the macro commands
108112explained in the following chapters.
109113
@@ -127,11 +131,19 @@ is put to the command line output.
127131Called without any other argument, pumla writes out to the console a
128132list of all ` .puml ` files that are ` pumla ` files (marked with either ` 'PUMLAMR `
129133(PUMLA-ModelRepo) or ` 'PUMLADR ` (PUMLA-DiagramRepo) in the first line of the file).
134+ Requirements are described in YAML files (` .yaml ` ) and will therefore not
135+ be shown by this command, as they are not standalone PlantUML-compliant files.
130136
131137### ` pumla elements `
132138Writes out to the console all ` pumla ` model elements and diagrams of
133139the model repository and diagram repository, with all their relevant
134- attributes.
140+ attributes. This does not include requirements, for that we have the
141+ call described next.
142+
143+ ### ` pumla reqs ` - not yet implemented
144+ Writes out to the console all ` pumla ` requirements elements and diagrams of
145+ the model repository and diagram repository, with all their relevant
146+ attributes.
135147
136148### ` pumla getjson <subcommand> `
137149Prints out a JSON data structure containing the request elements (by subcommand).
@@ -183,14 +195,19 @@ This comment marks the file as a re-usable asset of a dynamic behaviour
183195element description. In a file marked like that, only the dynamic aspect
184196should be modelled, by e.g. a sequence, state or activity diagram.
185197
198+ ### ` 'PUMLARR `
199+ This comment put into the first line of a ` .yaml ` file marks the file
200+ as ` pumla ` requirement element description that shall be part of the re-usable
201+ requirements repository.
202+
186203---
187204
188205## Extension Macros
189206The following macros (that are PlantUML unquoted functions and procedures) can be
190207used within each PlantUML file by including ` pumla_macros.puml ` . They are the
191208user "API" of ` pumla ` .
192209
193- ## Creating Re-usable Elements
210+ ## Creating Re-usable Model Elements
194211
195212### ` PUMLAReUsableAsset($name : string, $alias : string, $type : string, $stereotypes : string (optinal)) {...} `
196213Creates a re-usable asset (RUA). The asset can be of any PlantUML type, like class, component, node, rectangle, ...
@@ -313,7 +330,7 @@ you manage your architecture relations and artefacts.
313330Similar to previous, but instead of information about file path and file name you
314331get the list of tagged values that are attached to each of the connections.
315332
316- ## Putting Re-usable Elements onto Diagrams
333+ ## Putting Re-usable Model Elements onto Diagrams
317334
318335### ` PUMLAPutElement( elem_alias ) `
319336This macro puts the model element with the given alias ` elem_alias ` onto the diagram.
@@ -504,6 +521,11 @@ as the table cannot be shown within the port element (and would not
504521make sense). This is the only way to show the tagged value table
505522of a port.
506523
524+ ### ` PUMLAPutReqsBreakdownTraceFor($alias) `
525+ Puts the requirement with the given alias onto the diagram and follows
526+ its "derived" breakdown and puts further requirements onto the diagram
527+ that the alias requirement is derived to. It connects the requirements
528+ with a "realization" relation.
507529
508530## Diagram Filters
509531
@@ -572,6 +594,108 @@ global variable `$PUMVarShowBodyInternals` is true. With this macro, the given a
572594of which not to show the internals. In order to show internals for that element within the scope of the same diagram
573595again, the "filter list" has to be resetted with the next macro.
574596
597+ ## Creating Re-usable Requirements Elements
598+
599+ ### Creating a single re-usable docs-as-code requirement
600+ Requirements are stored in YAML files (` .yaml ` ) with a file marking ` #PUMLARR ` in the first line.
601+ Then, within the file, one or more requirements can be described. The requirements are elements
602+ of a YAML list with at least the following attributes:
603+ - alias: the unique short-ID
604+ - type: describing the kind of requirement. Can be set according to needs. Could be "Requirement", "Constraint", ...
605+ - status: also here, the status model is not defined by PUMLA; put status values as you need and like.
606+ - derived_from: the alias of the (parent) requirement where this requirement is derived from.
607+ - content: The text content of the requirement itself.
608+
609+ The following attributes are optional:
610+ - taggedvalues: a list of tag/values pairs, where values is list by itself.
611+
612+ Requirement files can be distributed across the folders in a git repository and therefore be
613+ stored close to the code if wanted. The ` pumla update `
614+ command will find each of them, considering the blacklist.
615+
616+ Example:
617+ ```
618+ File: req.yaml
619+
620+ #PUMLARR
621+ - type: Requirement
622+ alias: REQ_WS1
623+ status: decided
624+ derived_from:
625+ taggedvalues:
626+ - tag: "Vendor"
627+ values:
628+ - A Inc.
629+ - C Ltd.
630+ - tag: "Variant"
631+ values: [SysA, SysB]
632+ content:
633+ This is a requirement towards my Weather Station. The Weather Station shall
634+ be able to measure the temperature.
635+
636+ - type: Requirement
637+ alias: REQ_WS2
638+ status: new
639+ derived_from:
640+ content:
641+ This is another requirement. The Weather Station housing shall be blue.
642+ ```
643+
644+ ## Overview on the Requirements Repository of Re-usable Elements
645+ ### ` PUMLAPutAllReqsTable() `
646+ This macro puts all requirements of the ` reqsrepo_json.puml ` into a table on the diagram,
647+ with a count of the requirements as well as the files where the requirements are stored in. It
648+ is similar to the ` CheatSheets ` of the architecture model elements.
649+
650+ ### ` PUMLAPutReqByCount($count) `
651+ This macro is solely meant for overview purposes, allowing you to quickly step through each
652+ single requirement in the requirements repository by addressing it by its number (` $count ` ).
653+
654+ Hint: The ` $count ` shall not be used to address a requirement a certain requirement or put
655+ it onto a real diagram with a real purpose. The numbering in the requirements repository can
656+ change by calling ` pumla update ` , so that the ` $count ` may point to another requirement.
657+ In real diagram, requirements shall always be addressed by their unique short-ID, the ` alias ` .
658+
659+ ## Putting Re-usable Requirements Elements onto Diagrams
660+ ### ` PUMLAPutReq($alias) `
661+ Puts the requirement with the given alias in form of a PlantUML JSON table with all its
662+ attributes onto the diagram.
663+
664+ ### ` PUMLAPutAllReqs() `
665+ Puts all the requirements of the requirements repository (` reqsrepo_json.puml ` ) onto the
666+ diagram.
667+
668+ ### ` PUMLAPutAllReqsWithStatusTable($value) `
669+ Puts all requirements of the requirements repository, where the status has the given ` $value ` ,
670+ onto the diagram.
671+
672+ ### ` PUMLAPutAllReqsWithTypeTable($value) `
673+ Puts all requirements of the requirements repository, where the type has the given ` $value ` ,
674+ onto the diagram.
675+
676+ ### ` PUMLAPutReqBrief($alias) `
677+ Puts the requirement with the given alias onto the diagram, focussing on a limited amount of
678+ attributes:
679+ - type
680+ - content
681+ - status
682+
683+ ### ` PUMLAPutReqAsNote($alias) `
684+ Puts the brief requirement with the given alias wrapped into a PlantUML note onto the diagram.
685+
686+ Hint: This macro can be useful to put the requirement onto diagrams along with classes, components or
687+ dynamic behaviour descriptions.
688+
689+ ### ` PUMLAPutAllReqsBrief() `
690+ Puts all the requirements of the requirements repository (` reqsrepo_json.puml ` ) onto the
691+ diagram, but only with the brief set of attributes (see ` PUMLAPutReqBrief($alias) ` ).
692+
693+ ## Working with Requirements Traceability
694+ ### ` PUMLAPutReqsBreakdownTraceFor($alias) `
695+ Puts the trace for a requirement with given alias down on the diagram. Each requirement along the
696+ trace is put with its brief description. The trace is modelled with a "realizes" relation, so pointing
697+ from a derived requirement to a parent requirement where it was derived from.
698+
575699## Working around some PlantUML limitations
576700
577701### ` PUMLASetAsComponentDiagram() `
0 commit comments