Skip to main content
nxDocInventoryTree is a Nextedy Solutions Velocity macro that generates a complete hierarchical document inventory table for a workspace, showing the system element tree with associated documents, type badges, status indicators, item counts, and tool links. This macro is the foundational navigator component used across all TestAuto2 dashboard spaces (Requirements, Design, Risks, Testing) to provide users with a unified view of documentation structure organized by system element hierarchy.

Overview

The macro serves as an all-in-one document discovery and navigation interface that:
  • Loads all system elements from the project hierarchy
  • Filters documents to a specific workspace (space)
  • Renders element headers with type badges (SYSTEM, SUBSYSTEM, COMPONENT)
  • Displays document rows with type badges, status, work item counts
  • Auto-detects Risksheet (DFMEA/PFMEA/HARA) vs PowerSheet (Characteristics/Functions) vs generic documents
  • Provides direct tool links to open documents in Risksheet or Polarion tracker
  • Supports optional system-element-based grouping for hierarchical display

Macro Signature

ParameterTypeDefaultDescription
$workspaceFilterString(required)Space key or name to filter documents (e.g., ‘Requirements’, ‘Risks’, ‘Design’, ‘Testing’)
$columnLabelString’Document’Header text for the hierarchy column (e.g., ‘System Element / Document’, ‘Module’)
$groupBySystemElementBooleanfalseIf true, organizes documents by system element tree; if false, flat list per space

Output Variables

VariableTypeDescription
$nxDocInventoryMapLinkedHashMap keyed by system element ID, values are document lists per element
$nxDocCountIntegerTotal document count in filtered workspace
$nxElementCountIntegerTotal system element count with documents

Rendered Table Structure

The macro produces an HTML table with the following columns:
ColumnContentExample
HierarchySystem element name with type badge (SYSTEM/SUBSYSTEM/COMPONENT) or document name[SYSTEM] AEB System or System DFMEA Report
Type BadgeSmall colored label indicating document type (RISKSHEET, POWERSHEET, REPORT, WIKI)RISKSHEET (orange), POWERSHEET (blue)
StatusDocument workflow state or work item countsDraft, In Review, Published, 25 items
CountNumber of work items or sub-elements36 FM, 5 docs, 10 controls
Tool LinkIcon-button to open document in Risksheet or TrackerEdit in Risksheet

Workspace Filters

The macro works with any Polarion project space. Common TestAuto2 uses:
Space FilterPurposeTypical Documents
RequirementsCustomer/System/Design requirements documentsRequirements RTM, System Specifications
DesignDesign artifacts and characteristicsCharacteristics sheets, Functions, Design Verification
RisksRisk analysis and FMEA documentsHAZID, DFMEA, PFMEA, Control Plan, Risk Controls
TestingVerification and validation test documentsTest Cases, Validation Tests, V&V Reports

Usage Examples

Basic Usage: Flat Document List

#nxDocInventoryTree("Requirements" "Document" false)
Produces a flat table of all documents in the Requirements space, sorted by document name. Output:
| System Element / Document          | Type         | Status    | Count        | Tool |
|------------------------------------|--------------|-----------|--------------|------|
| System Requirements Specification   | POWERSHEET   | Published | 31 items     | ✎    |
| CUS-REQ-001 Analysis              | WIKI         | Draft     | 5 items      | ✎    |
| System Design Report               | DOCUMENT     | Approved  | 12 items     | ✎    |

Hierarchical Usage: Grouped by System Element

#nxDocInventoryTree("Risks" "System Element / Document" true)
Produces a nested tree where each system element (System → Subsystem → Component) is a row, followed by child documents associated with that element. Output:
System Element / DocumentTypeStatusCountTool
-------------------------------------------------------------------------------------------
[SYSTEM] AEB System8 docs
├─ System SFMEARISKSHEETPublished36 FM
├─ HARA AnalysisRISKSHEETApproved23 hazards
└─ Risk Control PlanRISKSHEETDraft218 items
[SUBSYSTEM] ECU Processing Subsystem3 docs
├─ Subsystem SFMEARISKSHEETPublished42 FM
├─ Design CharacteristicsPOWERSHEETPublished24 items
└─ FunctionsPOWERSHEETPublished8 items
[COMPONENT] System-on-Chip (SoC)2 docs
├─ Component DFMEARISKSHEETIn Review22 FM
└─ Design CharacteristicsPOWERSHEETPublished6 items

Requirements Space Example

#nxDocInventoryTree("Requirements" "Document" false)
Typical output for the Requirements dashboard:

Document Type Detection

The macro auto-detects document types based on naming convention and configuration:
Detection PatternDocument TypeIconColor
Contains ‘FMEA’ or ‘HARA’ or ‘Risk’ in nameRISKSHEETOrange
Contains ‘RTM’ or ‘Characteristics’ or ‘Functions’POWERSHEETBlue
Contains ‘Report’ or ‘Traceability’ or ‘Coverage’REPORTGreen
Default (wiki pages, generic documents)WIKI📄Gray

System Element Hierarchy

When $groupBySystemElement = true, the macro traverses the project’s system element tree:
  • project.systemElements (filtered by Type = “System”)
    • systemElements (Type = “Subsystem”)
      • systemElements (Type = “Component”)
        • associated documents
        • failure modes, characteristics, functions
      • associated documents
    • associated documents
Each level is indented and prefixed with element count and type badge.

Integration with Other Macros

nxDocInventoryTree typically works alongside:
MacroPurposeIntegration
nxLinkCoverageTraceability coverageBoth appear on space dashboard below doc inventory
nxStatCountWork item type statisticsStatistics bar above doc inventory
nxCoverageBarGap visualizationLinked from doc inventory gaps
nxFmeaElementBlockFMEA-specific rowsCalled per element in Risks space variant
Standard dashboard structure: (1) Space banner + statistics bar → (2) Document inventory tree → (3) Traceability coverage bars → (4) Report quick-links

Common Customizations

Filter by Document Status

#set($statusFilter = "Published")
#nxDocInventoryTree("Requirements" "Document" false)
## Then filter rendered rows to show only $statusFilter

Custom Column Headers

#nxDocInventoryTree("Design" "Design Element / Artifact" true)

Two-Column Grid Layout

For dashboard space optimization, render two doc inventory tables side-by-side:
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
  <div>
    ## Requirements space inventory
    #nxDocInventoryTree("Requirements" "Document" false)
  </div>
  <div>
    ## Design space inventory  
    #nxDocInventoryTree("Design" "Document" false)
  </div>
</div>

Performance Notes

For projects with 50+ documents, the macro may take 2–5 seconds to render. Consider:
  • Caching the rendered output if the page is accessed frequently
  • Using $groupBySystemElement = false (flat list) for faster initial render
  • Filtering to specific spaces to reduce document count

Troubleshooting

ProblemCauseSolution
Empty tableSpace filter name doesn’t matchVerify space name matches Polarion project space exactly (case-sensitive)
Missing documentsDocuments not in specified spaceCheck document location in Polarion; move to correct space if needed
Performance slowLarge document count or complex hierarchySwitch to flat mode (false), reduce time range, or cache output
Type badges not displayingCSS not loadedEnsure nxCommonStyles macro runs before nxDocInventoryTree
Links brokenDocument ID changed or movedRe-render dashboard to refresh cached document references