Nextedy Velocity Macro
Renders a single system element row in DFMEA Coverage Gap Reports with failure mode counts, Action Priority distribution, and FMEA module association tracking.
Overview
The nxFmeaElementBlock macro generates one row in a hierarchical system element table, showing:
- System element name and hierarchy level (System, Subsystem, Component)
- Link to associated DFMEA (Design FMEA) module
- Count of failure modes defined for this element
- Distribution of Action Priority (AP) classifications: Low (L), Medium (M), High (H), Not Assigned (N/A)
- Pre-mitigation and post-mitigation AP bucket counts for risk reduction tracking
This macro is used in the System DFMEA Report dashboard to build hierarchical coverage tables and track which system elements have documented FMEAs and which are missing analysis.
The macro is specifically designed for hierarchical DFMEA reporting where each system element (System → Subsystem → Component) requires a corresponding DFMEA module documenting failure modes and risk controls. It enables visual scanning of FMEA completeness and risk distribution across the system hierarchy.
Macro Signature
#macro(nxFmeaElementBlock $element $indentLevel $failureModeList $premitigationAPField $postmitigationAPField)
Parameters
| Name | Type | Required | Description |
|---|
$element | WorkItem | Yes | System element (type systemElement) to render in the table row |
$indentLevel | Integer | Yes | Visual indent level for hierarchy (0 = System, 1 = Subsystem, 2 = Component). Controls left margin and badge display. |
$failureModeList | Collection | Yes | Collection of failure mode work items (type failureMode) to analyze for this element. Typically pre-filtered to the element’s FMEA module via module field. |
$premitigationAPField | String | Yes | Velocity field name for pre-mitigation Action Priority (e.g., premitigationAP). Used to count pre-mitigation L/M/H distribution. |
$postmitigationAPField | String | Yes | Velocity field name for post-mitigation Action Priority (e.g., postmitigationAP). Used to count post-mitigation L/M/H distribution to show risk reduction. |
Global Variables Set
The macro updates these global counters used by parent reports to track FMEA coverage:
| Variable | Type | Description |
|---|
$nxFmeaTotal | Integer | Incremented by 1 for each system element processed (total elements in scope) |
$nxFmeaExisting | Integer | Incremented by 1 if element has at least one failure mode in $failureModeList (elements with FMEA analysis) |
$nxFmeaMissing | Integer | Incremented by 1 if element has zero failure modes (elements lacking FMEA analysis — coverage gap) |
Rendered Output
The macro outputs a single HTML table row (<tr>) with the following cells:
| Indent + Element Badge | Element Name | FMEA Link | Total FM Count | Pre-Mit L | Pre-Mit M | Pre-Mit H | Pre-Mit N/A | Post-Mit L | Post-Mit M | Post-Mit H | Post-Mit N/A |
Output Structure
| Cell | Content | Notes |
|---|
| Hierarchy Indent + Badge | Visual indent (margin-left) + type badge (SYSTEM / SUBSYSTEM / COMPONENT) | Indent level 0 = 0px, level 1 = 20px, level 2 = 40px. Badge color per element type. |
| Element Name | $element.Title (e.g., “Power Management System”) | Hyperlink to element work item in Polarion. |
| FMEA Module Link | Hyperlink to associated DFMEA module or ⚠️ warning icon if missing | Macro queries for riskSpecification module with systemElementId matching element; if not found, displays “FMEA Missing” alert and increments $nxFmeaMissing. |
| Total FM Count | Count of items in $failureModeList for this element | Sum of L + M + H + N/A in pre-mitigation column. |
| Pre-Mitigation L/M/H/N/A | Integer counts per AP classification | Calculated by iterating $failureModeList and reading $element.{premitigationAPField}. Null or unrecognized values counted as N/A. |
| Post-Mitigation L/M/H/N/A | Integer counts per AP classification | Same logic using $postmitigationAPField. Compares pre vs post to show risk reduction (e.g., 3 High → 1 High = effective mitigation). |
Usage Example
## Initialize coverage counters at start of report
#set($nxFmeaTotal = 0)
#set($nxFmeaExisting = 0)
#set($nxFmeaMissing = 0)
## Query all system elements at hierarchy root
#set($systemElements = $p.getWorkItemsInCollection())
## Iterate system elements and render rows
#foreach($element in $systemElements)
#if($element.Type == "systemElement" && $element.systemElementType == "System")
## Query failure modes for this element's DFMEA module
#set($fmeaModule = $p.queryWorkItems("module:$element.systemElementId"))
#set($failureModes = $p.queryWorkItems("type:failureMode AND module:$fmeaModule.Id"))
## Render element block row with counters
#nxFmeaElementBlock($element 0 $failureModes "premitigationAP" "postmitigationAP")
## Recursively render subsystems
#set($subsystems = $p.queryWorkItems("type:systemElement AND parent:$element.Id AND systemElementType:Subsystem"))
#foreach($subsystem in $subsystems)
#set($subFmeaModule = $p.queryWorkItems("module:$subsystem.systemElementId"))
#set($subFailureModes = $p.queryWorkItems("type:failureMode AND module:$subFmeaModule.Id"))
#nxFmeaElementBlock($subsystem 1 $subFailureModes "premitigationAP" "postmitigationAP")
#end
#end
#end
## Report coverage statistics after table
Coverage: $nxFmeaExisting of $nxFmeaTotal elements have FMEAs ($nxFmeaMissing missing)
How It Finds Associated FMEAs
The macro uses the module field on failure modes to associate them with system elements:
- Module Reference Model: Each failure mode work item has a
module field pointing to its parent riskSpecification document (DFMEA)
- Element Matching: The DFMEA module is matched to a system element by comparing the module’s
systemElementId custom field to the element’s ID
- Failure Mode Filtering: Only failure modes whose
module.systemElementId matches the current element are counted
- Missing FMEA Detection: If no failure modes are found, the element is flagged as “missing FMEA” and a warning is displayed
The module field establishes the document-to-element relationship. When creating a new DFMEA for a subsystem, populate the module’s systemElementId field with the subsystem’s element ID. This enables the macro to automatically discover and link FMEAs.
Action Priority Bucketing Logic
The macro counts failure modes into AP categories using inline Velocity logic:
#foreach($fm in $failureModeList)
#if($fm.{premitigationAPField} == "H")
#set($premitH = $premitH + 1)
#elseif($fm.{premitigationAPField} == "M")
#set($premitM = $premitM + 1)
#elseif($fm.{premitigationAPField} == "L")
#set($premitL = $premitL + 1)
#else
#set($premitNA = $premitNA + 1)
#end
#end
AP Values and Meanings
| Value | Meaning | AIAG-VDA Rule |
|---|
H | High Action Priority | Severity ≥7 AND (Occurrence ≥6 OR Detection ≥7) — requires immediate mitigation |
M | Medium Action Priority | Severity ≥4 AND medium occurrence/detection combinations — schedule for near-term resolution |
L | Low Action Priority | Severity ≤6 AND low occurrence/detection — track but lower urgency |
| (null or other) | Not Assigned (N/A) | Missing S/O/D ratings or incomplete AP assessment |
Risk Reduction Interpretation
Comparing pre-mitigation vs post-mitigation AP distributions reveals mitigation effectiveness:
Decision Matrix: When to Flag Elements
| Condition | Alert Level | Action |
|---|
| Post-mitigation H count > 0 | Danger ⚠️ | Escalate to safety engineer; additional controls required |
| Post-mitigation M count > 0 | Warning | Review controls; prioritize for next release |
| Post-mitigation L count = Total FM Count | Success ✅ | All risks mitigated to acceptable level; close FMEA |
| Missing FMEA (failure mode count = 0) | Warning | Schedule DFMEA for this element; block release until complete |
Integration with Parent Report
The System DFMEA Report typically:
- Initializes the three counters (
$nxFmeaTotal, $nxFmeaExisting, $nxFmeaMissing) to zero
- Iterates all system elements in hierarchy order
- Calls
#nxFmeaElementBlock() for each element, passing pre-filtered failure mode collections
- After the table, displays coverage metrics:
nxFmeaExisting / nxFmeaTotal as a percentage bar
- Optionally displays a list of missing FMEAs (where
$nxFmeaMissing > 0) with drill-down links to create FMEAs
| Macro | Purpose | Relationship |
|---|
| nxCountByEnum | Generic enum aggregation | Alternative approach for AP bucketing without indent/hierarchy |
| nxFindChildElements | Hierarchical element traversal | Often paired to iterate subsystems/components for recursive table building |
| nxAPBuckets | Action Priority distribution (non-hierarchical) | Simplified AP counting for flat failure mode lists without element context |
| nxCoverageBar | Visual coverage progress bar | Used after the element block table to render coverage percentage and gap indicator |
Common Use Cases
DFMEA Completeness Check
Display all system elements and flag those without FMEAs:
#set($nxFmeaTotal = 0)
#set($nxFmeaExisting = 0)
#set($nxFmeaMissing = 0)
#foreach($element in $systemElements)
#set($fms = $p.queryWorkItems("type:failureMode AND module.systemElementId:$element.Id"))
#nxFmeaElementBlock($element 0 $fms "premitigationAP" "postmitigationAP")
#end
#if($nxFmeaMissing > 0)
!!! warning "FMEA Coverage Gap"
$nxFmeaMissing elements are missing DFMEA analysis. [Create FMEAs](/automotive/reference/guides/fmea/create-sfmea-document)
#end
Risk Reduction Tracking
Show pre vs post-mitigation risk distribution across the hierarchy to validate effectiveness of risk controls:
| System Element Total FM Pre-L Pre-M Pre-H Post-L Post-M Post-H Status |
|---|
| Power Management (SYS) 15 3 6 6 8 5 2 ⚠️ Review |
| ├─ Voltage Regulator 8 1 3 4 4 3 1 ⚠️ Review |
| └─ Battery Interface 7 2 3 5 4 2 1 ⚠️ Review |
Rows with post-mitigation H > 0 need additional risk controls or design changes.
Hierarchical Navigation
Render the table with clickable element names linking to the Polarion Tracker, enabling navigation from high-level coverage view to detailed FMEA work items:
<a href="$p.getWorkItemTrackerUrl($element.Id)">$element.Title</a>
Troubleshooting
Missing FMEA Alert Displayed But FMEA Exists
Cause: The riskSpecification module’s systemElementId field does not match the system element ID.
Resolution: Open the DFMEA module and verify systemElementId is set to the element’s ID (e.g., SYS-001). Update if incorrect.
AP Counts Show All “N/A”
Cause: Field name is incorrect or failure modes have null AP values.
Resolution:
- Verify field names match work item schema:
premitigationAP, postmitigationAP (case-sensitive)
- Open risksheet and assign S/O/D ratings to generate AP values
- Check that failure modes are scoped to the correct FMEA module via
module field
Elements Show Zero Failure Modes
Cause: Failure mode collection is empty or module filter is not working.
Resolution:
- In risksheet, create at least one failure mode for this element’s FMEA
- Ensure failure mode’s
module field links to the element’s DFMEA document
- Verify element ID and FMEA module
systemElementId match exactly
See Also