You can use M2Doc to extract keys, such as guideword names, and values, such as failure descriptions, from a guideword analysis table into a report.
The basic elements needed for including the guideword analysis information in the M2Doc report are the analysis itself and each element it contains. You can access these through the analysis model. Services can extract for example the guideword definitions function names.
The following example shows a guideword table and how to access elements in it.
Table 10.1: Sample Guideword Analysis Table
| Element | NO OR NOT | MORE | LESS | AS WELL AS |
|---|---|---|---|---|
| [F001] Main Function | [MF001] No main | [MF002] Not enough main | ||
| [F002] Secondary Function | [MF003] No secondary | [MF004] Too much secondary | [MF005] Not enough secondary | |
| [F003] Diagnose Function |
Let's say you use the variable analysis for your guideword analysis.
To list the total number of entries, use
{ m:analysis.entries->size() }Result: 3
To list the number of guidewords, use
{ m:analysis.guidewords->size() }Result: 4
To access the name of
entry1, you can use:{ m:entry1.element.name }{ m:analysis.entries->first().element.name }
Result: Main Function
To count the number of entries, such as malfunctions, in
entry2, use{ m:entry2.eval('self.guidewordToFailures.size() + ""') }Result: 3
To recreate part of the guideword analysis table as a table in the M2Doc report, you can
use a template as shown below. Note that the table is structured to list the guidewords and
findings vertically instead of horizontally. This is because there are variable numbers of
guideword results and findings results for each entry. Because we are using for
loops, the table can grow vertically, but not horizontally.
| Element | Guideword | Findings |
{ m:for e | analysis.entries }
{ m:e.element.name } |
{ m:for f | e.guidewordToFailures }
{ m:f.key().name } |
{ m:for mf | f.value() }
{ m:mf.name } |
{ m:endfor }
{ m:endfor }
{ m:endfor }
The resulting table is shown below.
Table 10.2: Resulting M2Doc Table
| Element | Guideword | Findings |
|---|---|---|
| Main Function | ||
| NO OR NOT | ||
| No main | ||
| LESS | ||
| Not enough main | ||
| Secondary Function | ||
| MORE | ||
| Too much secondary | ||
| NO OR NOT | ||
| No secondary | ||
| LESS | ||
| Not enough secondary | ||
| Diagnose Function |