Skip to content

Commit 8e31a10

Browse files
authored
Merge pull request #55 from DrMarkusVoss/52-add-requirements-in-docs-as-code-format-with-traceability-to-architecture-elements
further example and small typo fixes.
2 parents 9ec811a + b502c58 commit 8e31a10

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed

Examples_Reqs.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
These are examples from the `./test/examples/WeatherStation` section. You find the
33
source code of the .puml and .yaml files that form the example model repository
44
there. In order to get the example running on your computer, you need
5-
to run first `pumla init`, then `pumla update`" in the examples directory,
6-
because the paths in the model repo file (./test/examples/WeatherStation/reqsrepo_json.puml)
5+
to run first `pumla init`, then `pumla update` in the examples directory,
6+
because the paths in the reqs repo file (./test/examples/WeatherStation/reqsrepo_json.puml)
77
need to be updated to the directory structure on your computer. Currently
88
the model repo file has the paths from the structure as I have it on my
99
machine. You can't run the pumla update from the main path of pumla, as
@@ -12,7 +12,7 @@ The examples section will be ignored from the top level. So you have to go
1212
down to the examples and call the pumla update from that directory.
1313

1414
If you are changing the contents of the examples to play around, in order for a
15-
change to become alive, you need to call `pumla update` again. cd
15+
change to become alive, you need to call `pumla update` again.
1616

1717
## E#0: Creating Re-usable Requirements
1818
Other than with architecture elements, in `pumla` you write the requirements in YAML and not
@@ -73,14 +73,25 @@ the trace between the requirements is exposed. All with just one `pumla` macro c
7373

7474
![](test/examples/WeatherStation/pics/exampleAllReqsBrief.png)
7575
### E#1.3: Overview of all requirements (Cheat Sheet)
76-
See here, how with one `pumla` macro `PUMLAPutAllReqsTable()` and overview table is put onto
76+
See here, how with one `pumla` macro `PUMLAPutAllReqsTable()` an overview table is put onto
7777
the diagram, counting the requirements and showing in which files they are implemented.
7878

7979
[./test/examples/WeatherStation/exampleReqCheatSheet.puml](test/examples/WeatherStation/exampleReqCheatSheet.puml)
8080

8181
![](test/examples/WeatherStation/pics/exampleReqCheatSheet.png)
8282

83-
## E#2: Put single requirements onto a diagram
83+
### E#1.4: Overview of all requirements that have a dedicated status value
84+
See here, how with one `pumla` macro `PUMLAPutAllReqsWithStatusTable("decided")` an overview table is put onto
85+
the diagram showing only requirements with the status "decided", counting the requirements and showing in which
86+
files they are implemented.
87+
88+
[./test/examples/WeatherStation/exampleReqsWithStatusValue.puml](test/examples/WeatherStation/exampleReqsWithStatusValue.puml)
89+
90+
![](test/examples/WeatherStation/pics/exampleReqsWithStatusValue.png)
91+
92+
A similar macro exists to create an overview selecting wrt. the "type" attribute: `PUMLAPutAllReqsWithTypeTable($value)`.
93+
94+
## E#2: Putting single requirements onto a diagram
8495
Here is an example where two requirements are put onto a diagram, one with a reduced subset of
8596
attributes.
8697

pumla_internal.puml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ end note
2222
!end procedure
2323

2424
!unquoted procedure PUMLAPutElementErrorCheck($suc, $elemalias)
25-
PUMLAErrorCheck($suc, $elemalias, "Could not put element with alias", "Element was not found in model repo.", "- try to update the model repo, or %newline()- check the alias for misspellings.")
25+
PUMLAErrorCheck($suc, $elemalias, "Could not put element with alias", "Element was not found in model/req repo.", "- try to update the model/req repo, or %newline()- check the alias for misspellings.")
2626
!end procedure
2727

2828
!unquoted procedure PUMLACreateInstanceError($elemalias)
29-
PUMLAErrorCheck("0", $elemalias, "Could not create instance of element with alias", "The element that should be instantiated %newline()was not found in the model repo.", "- try to update the model repo, or %newline()- check the alias for misspellings.")
29+
PUMLAErrorCheck("0", $elemalias, "Could not create instance of element with alias", "The element that should be instantiated %newline()was not found in the model repo.", "- try to update the model/req repo, or %newline()- check the alias for misspellings.")
3030
!end procedure
3131

3232
' --------------------------------------------

pumla_macros_reqs.puml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@startuml
21

32
' ############################################
43
' ---------------------------------------------
@@ -31,9 +30,6 @@
3130
!return $result
3231
!endfunction
3332

34-
35-
36-
3733
' ############################################
3834
' ---------------------------------------------
3935
' introduce "newline" into a string in order to
@@ -284,7 +280,7 @@ note as allreqstable
284280
!if $r.status==$value
285281
!$cntstat=$cntstat+1
286282
| | | | | | |
287-
| $r.alias | $r.type | $r.content | $r.status | $r.derived_from | $r.derived_to | $r.in_file |
283+
| $r.alias | $r.type | _PUMLABreakLineSL($r.content) | $r.status | formatListSL($r.derived_from) | formatListSL($r.derived_to) | $r.in_file |
288284
!endif
289285
!endfor
290286

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@startuml
2+
!include reqsrepo_json.puml
3+
!include pumla_macros.puml
4+
5+
top to bottom direction
6+
7+
' put table overview with all reqs that
8+
' have a status that matches "decided"
9+
PUMLAPutAllReqsWithStatusTable("decided")
10+
11+
@enduml

test/examples/WeatherStation/exampleSingleReqs.puml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ top to bottom direction
66

77
' show how a requirement with with full
88
' description is put onto a diagram
9-
PUMLAPutReq(REQ_WS1)
9+
PUMLAPutReq(REQ_WS)
1010

1111
' show how a requirement with a brief
1212
' description is put onto a diagram
39.1 KB
Loading

0 commit comments

Comments
 (0)