-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
further macros for reqs and trace handling. allowing more than one de…
…rived_to req. needs to be done for derived_from too. further examples.
- Loading branch information
1 parent
05f2bd6
commit 19d5fbc
Showing
11 changed files
with
164 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,111 @@ | ||
' ############################################ | ||
' --------------------------------------------- | ||
' create a req as an object with reduced number | ||
' of attributes. | ||
' Hint: objects are parts of class diagrams. | ||
' in order to mix them or use them on other | ||
' diagrams, "allowmixing" needs to be used. | ||
!unquoted procedure _PUMLACreateReqObject($alias) | ||
object $r.alias { | ||
|= type | $r.type | | ||
|= content | $r.content | | ||
|= status | $r.status | | ||
} | ||
!endprocedure | ||
|
||
' ############################################ | ||
' --------------------------------------------- | ||
' create the reqs trace starting with the | ||
' requirement with the given alias in a | ||
' recursive way. | ||
!unquoted procedure PUMLAPutReqsBreakdownTraceFor($alias) | ||
' recursive way with an iteration counter to | ||
' make sure we do not consider elements up the | ||
' trace, only down. | ||
!unquoted procedure _PUMLARecursivePutReqsBreakdownTraceFor($alias, $itcnt) | ||
!$r = null | ||
!$cnt = %intval($itcnt) | ||
|
||
!foreach $r in $allreqs.reqs | ||
!if $r.alias == $alias | ||
object $r.alias { | ||
|= Type | $r.type | | ||
|= Content | $r.content | | ||
|= Status | $r.status | | ||
} | ||
_PUMLACreateReqObject($r.alias) | ||
|
||
!if %not($r.derived_from==null) | ||
' do not go the trace up on the first element, only down | ||
!if %not($r.derived_from==null) && %not($cnt==0) | ||
$r.derived_from <|-- $r.alias | ||
!endif | ||
|
||
!$cnt = $cnt + 1 | ||
!if %not($r.derived_to==null) | ||
PUMLAPutReqsBreakdownTraceFor($r.derived_to) | ||
!foreach $dtra in $r.derived_to | ||
_PUMLARecursivePutReqsBreakdownTraceFor($dtra,$cnt) | ||
!endfor | ||
!endif | ||
|
||
!endif | ||
!endfor | ||
|
||
!endprocedure | ||
|
||
|
||
' ############################################ | ||
' --------------------------------------------- | ||
' create the reqs trace starting with the | ||
' requirement with the given alias in a | ||
' recursive way. | ||
!unquoted procedure PUMLAPutReqsBreakdownTraceFor($alias) | ||
_PUMLARecursivePutReqsBreakdownTraceFor($alias,0) | ||
!endprocedure | ||
|
||
|
||
|
||
' ############################################ | ||
' --------------------------------------------- | ||
' put a requirement with a given alias onto | ||
' the diagram | ||
!unquoted procedure PUMLAPutReq($alias) | ||
!foreach $r in $allreqs.reqs | ||
!if $r.alias == $alias | ||
json $r.alias $r | ||
!endif | ||
!endfor | ||
!endprocedure | ||
|
||
' ############################################ | ||
' --------------------------------------------- | ||
' put a requirement with reduced number of | ||
' attributes for a given alias onto | ||
' the diagram | ||
!unquoted procedure PUMLAPutReqBrief($alias) | ||
!foreach $r in $allreqs.reqs | ||
!if $r.alias == $alias | ||
_PUMLACreateReqObject($r.alias) | ||
!endif | ||
!endfor | ||
!endprocedure | ||
|
||
!endprocedure | ||
' ############################################ | ||
' --------------------------------------------- | ||
' put a requirement with a given alias onto | ||
' the diagram wrapped into a note | ||
!unquoted procedure PUMLAPutReqAsNote($alias) | ||
!foreach $r in $allreqs.reqs | ||
!if $r.alias == $alias | ||
note as $r.alias #white | ||
{{ | ||
PUMLAPutReqBrief($alias) | ||
}} | ||
end note | ||
!endif | ||
!endfor | ||
!endprocedure | ||
|
||
' ############################################ | ||
' --------------------------------------------- | ||
' put all requirements with reduced number of | ||
' attributes and trace onto the diagram | ||
!unquoted procedure PUMLAPutAllReqsBrief() | ||
!foreach $r in $allreqs.reqs | ||
_PUMLACreateReqObject($r.alias) | ||
!if %not($r.derived_from==null) | ||
$r.derived_from <|-- $r.alias | ||
!endif | ||
!endfor | ||
!endprocedure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#PUMLARR | ||
- type: Requirement | ||
alias: REQ_SW_CWeather1 | ||
status: decided | ||
derived_from: REQ_WS1 | ||
taggedvalues: | ||
- tag: "Level" | ||
values: "Software" | ||
- tag: "Variant" | ||
values: [SysA, SysB] | ||
content: | ||
There shall be one central class to manage all data regarding weather. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@startuml | ||
!include reqsrepo_json.puml | ||
!include pumla_macros.puml | ||
|
||
' put all requirement onto a diagram | ||
' and show the trace among them. | ||
PUMLAPutAllReqsBrief() | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@startuml | ||
!include reqsrepo_json.puml | ||
!include modelrepo_json.puml | ||
!include pumla_macros.puml | ||
|
||
!$PUMVarShowBodyInternals = %false() | ||
!$PUMVarShowInterfaces = %false() | ||
|
||
allowmixing | ||
|
||
PUMLAPutElement(tempSys) | ||
PUMLAPutReqBrief(REQ_WS1) | ||
|
||
tempSys <|-- REQ_WS1 | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
@startjson | ||
{"reqsrepopath": ".", "reqsrepofile": "./reqsrepo_json.puml", "reqs": [{"type": "Requirement", "alias": "REQ_WS1", "status": "decided", "derived_from": null, "taggedvalues": [{"tag": "Vendor", "values": ["A Inc.", "C Ltd."]}, | ||
{"tag": "Variant", "values": ["SysA", "SysB"]}], "content": "This is a requirement towards my Weather Station. The Weather Station shall be able to measure the temperature.", "derived_to": "REQ_SensorA1", "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS2", "status": "new", "derived_from": null, "content": "This is another requirement. The Weather Station housing shall be blue.", "derived_to": null, "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS3", "status": "aligned", "derived_from": null, "content": "The Weather Station shall display the measured temperature so that it is conveniently readable by a human looking at it in a distance of up to 3m.", "derived_to": null, "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS4", "status": "aligned", "derived_from": null, "content": "It shall be possible to switch the unit of the displayed temperature between degree Celsius and Fahrenheit.", "derived_to": null, "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS5", "status": "aligned", "derived_from": null, "content": "The unit in which the temperature is displayed shall stay as it is even after the batteries and/or the power supply has been removed.", "derived_to": null, "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_SensorA1", "status": "aligned", "derived_from": "REQ_WS1", "content": "The sensor shall be able to measure the temperature of the surrounding air in the room.", "derived_to": null, "in_file": "./tempSensorA/req.yaml"}]} | ||
{"tag": "Variant", "values": ["SysA", "SysB"]}], "content": "This is a requirement towards my Weather Station. The Weather Station shall be able to measure the temperature.", "derived_to": ["REQ_SW_CWeather1", "REQ_SensorA1"], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS2", "status": "new", "derived_from": null, "content": "This is another requirement. The Weather Station housing shall be blue.", "derived_to": [], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS3", "status": "aligned", "derived_from": null, "content": "The Weather Station shall display the measured temperature so that it is conveniently readable by a human looking at it in a distance of up to 3m.", "derived_to": [], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS4", "status": "aligned", "derived_from": null, "content": "It shall be possible to switch the unit of the displayed temperature between degree Celsius and Fahrenheit.", "derived_to": [], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS5", "status": "aligned", "derived_from": null, "content": "The unit in which the temperature is displayed shall stay as it is even after the batteries and/or the power supply has been removed.", "derived_to": [], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_SW_CWeather1", "status": "decided", "derived_from": "REQ_WS1", "taggedvalues": [{"tag": "Level", "values": "Software"}, | ||
{"tag": "Variant", "values": ["SysA", "SysB"]}], "content": "There shall be one central class to manage all data regarding weather.", "derived_to": [], "in_file": "./CWeather/req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_SensorA1", "status": "aligned", "derived_from": "REQ_WS1", "content": "The sensor shall be able to measure the temperature of the surrounding air in the room.", "derived_to": [], "in_file": "./tempSensorA/req.yaml"}]} | ||
@endjson | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
!$allreqs = {"reqsrepopath": ".", "reqsrepofile": "./reqsrepo_json.puml", "reqs": [{"type": "Requirement", "alias": "REQ_WS1", "status": "decided", "derived_from": null, "taggedvalues": [{"tag": "Vendor", "values": ["A Inc.", "C Ltd."]}, | ||
{"tag": "Variant", "values": ["SysA", "SysB"]}], "content": "This is a requirement towards my Weather Station. The Weather Station shall be able to measure the temperature.", "derived_to": "REQ_SensorA1", "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS2", "status": "new", "derived_from": null, "content": "This is another requirement. The Weather Station housing shall be blue.", "derived_to": null, "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS3", "status": "aligned", "derived_from": null, "content": "The Weather Station shall display the measured temperature so that it is conveniently readable by a human looking at it in a distance of up to 3m.", "derived_to": null, "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS4", "status": "aligned", "derived_from": null, "content": "It shall be possible to switch the unit of the displayed temperature between degree Celsius and Fahrenheit.", "derived_to": null, "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS5", "status": "aligned", "derived_from": null, "content": "The unit in which the temperature is displayed shall stay as it is even after the batteries and/or the power supply has been removed.", "derived_to": null, "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_SensorA1", "status": "aligned", "derived_from": "REQ_WS1", "content": "The sensor shall be able to measure the temperature of the surrounding air in the room.", "derived_to": null, "in_file": "./tempSensorA/req.yaml"}]} | ||
{"tag": "Variant", "values": ["SysA", "SysB"]}], "content": "This is a requirement towards my Weather Station. The Weather Station shall be able to measure the temperature.", "derived_to": ["REQ_SW_CWeather1", "REQ_SensorA1"], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS2", "status": "new", "derived_from": null, "content": "This is another requirement. The Weather Station housing shall be blue.", "derived_to": [], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS3", "status": "aligned", "derived_from": null, "content": "The Weather Station shall display the measured temperature so that it is conveniently readable by a human looking at it in a distance of up to 3m.", "derived_to": [], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS4", "status": "aligned", "derived_from": null, "content": "It shall be possible to switch the unit of the displayed temperature between degree Celsius and Fahrenheit.", "derived_to": [], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_WS5", "status": "aligned", "derived_from": null, "content": "The unit in which the temperature is displayed shall stay as it is even after the batteries and/or the power supply has been removed.", "derived_to": [], "in_file": "./req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_SW_CWeather1", "status": "decided", "derived_from": "REQ_WS1", "taggedvalues": [{"tag": "Level", "values": "Software"}, | ||
{"tag": "Variant", "values": ["SysA", "SysB"]}], "content": "There shall be one central class to manage all data regarding weather.", "derived_to": [], "in_file": "./CWeather/req.yaml"}, | ||
{"type": "Requirement", "alias": "REQ_SensorA1", "status": "aligned", "derived_from": "REQ_WS1", "content": "The sensor shall be able to measure the temperature of the surrounding air in the room.", "derived_to": [], "in_file": "./tempSensorA/req.yaml"}]} | ||
|