Complete examples

Each example on this page is a complete, working table view: a small model together with the view definition that renders it, each demonstrating one feature. Expand an example to read what it shows, download it as a ZIP archive, or copy its source from the page. All examples import the SysideViews library, which is not included in the downloads. Open an example in the SysMLv2 Views panel, or export it with syside table export.

Table view overview

A simple example table view - a small rover model renders as a table with six different columns.

Download Table View Overview (ZIP)

TableViewOverview.sysml
// Example: Table View Overview
package Rover {
    part def Chassis {
        doc
        /* Structural frame carrying every subsystem. */
        attribute mass;
    }
    part def Battery {
        doc
        /* Removable pack behind the rear axle. */
        attribute capacity;
        attribute mass;
    }
    part def Camera {
        attribute mass;
    }
    part def Wheel {
        attribute diameter;
        attribute mass;
    }
} // package Rover

package RoverContext {
    private import Rover::*;

    part def RoverAssembly {
        part chassis : Chassis {
            attribute :>> mass = 8.2;
        }
        part battery : Battery {
            attribute :>> capacity = 5000.0;
            attribute :>> mass = 1.4;
        }
        part navCamera : Camera;
        part leftWheel : Wheel {
            attribute :>> diameter = 0.35;
            attribute :>> mass = 0.6;
        }
        part rightWheel : Wheel {
            attribute :>> diameter = 0.35;
            attribute :>> mass = 0.7;
        }
    }
} // package RoverContext

package RoverViews {
    private import SysideViews::*;

    view overviewTable : SV::TVD::TableView {
        expose RoverContext::RoverAssembly::*;

        attribute :>> maxRowHeight = 150;

        view Part :> columnViews {
            attribute :>> featureRepresentation :> ColRep::declaredName;
            attribute :>> columnWidth = 120;
        }
        view Definition :> columnViews {
            :>> columnFeature = DefinitionsFirst(baseViewElement);
            attribute :>> featureRepresentation :> ColRep::declaredName;
        }
        view 'Mass (kg)' :> columnViews {
            :>> columnFeature = NamedUsage(
                baseViewElement,
                "mass",
                NameType::name,
                UsageKind::attributeUsage
            );
            attribute :>> featureRepresentation :> ColRep::featureValue;
            attribute :>> defaultValue = "(unset)";
        }
        view Attributes :> columnViews {
            :>> columnFeature = UsageList(baseViewElement, UsageKind::attributeUsage);
            attribute :>> featureRepresentation :> ColRep::name;
        }
        view Documentation :> columnViews {
            :>> columnFeature = DefinitionsFirst(baseViewElement);
            attribute :>> featureRepresentation :> ColRep::specificDocumentation;
            attribute :>> defaultValue = "n/a";
            attribute :>> TableViewDefinitions::TableView::columnViews::columnWidth = 160;
        }
        view 'Qualified Name' :> columnViews;
        :>> TableViewDefinitions::TableView::columnOrder = (
            Part, Definition, 'Mass (kg)', Attributes, Documentation, 'Qualified Name',
        );
    }
} // package RoverViews

Hierarchical table overview

A simple example hierarchical table - a small requirement hierarchy opens as a collapsible tree, already expanded: the first column carries the nesting, and the ID and documentation columns fill in each requirement’s details. Collapse a node, edit a documentation cell, and compare the rendered tree with the view definition that produced it.

Download Hierarchical Table Overview (ZIP)

HierarchicalTableOverview.sysml
// Example: Hierarchical Table Overview
package DroneRequirements {
    requirement def <'MISS-001'> MissionPerformance {
        doc
        /* The drone shall complete the delivery mission. */
    }

    requirement def <'SYS-001'> CruisingSpeed {
        doc
        /* The drone shall reach a cruising speed of at least 60 km/h. */
    }
    requirement def <'SYS-002'> OperationalRange {
        doc
        /* The drone shall have a minimum operational range of 30 km. */
        requirement battery : BatteryCapacity;
    }

    requirement def <'SUB-001'> MotorPower {
        doc
        /* Each motor shall output at least 150 W continuously. */
    }
    requirement def <'SUB-002'> BatteryCapacity {
        doc
        /* The battery shall store at least 1 500 Wh of usable energy. */
    }

    item def RequirementContext {
        requirement droneSystem : MissionPerformance {
            requirement speed : CruisingSpeed {
                requirement motor : MotorPower;
            }
            requirement range : OperationalRange {}
        }
    }
} // package DroneRequirements

package DroneRequirementsViews {
    private import SysideViews::*;

    view requirementsTree : SV::TVD::HierarchicalTableView {
        expose DroneRequirements::RequirementContext;
        attribute :>> defaultCollapse = false;

        view Name :>> hierarchicalColumn {
            attribute :>> TableViewDefinitions::TableView::columnViews::columnWidth = 188;
        }
        view ID :> columnViews {
            attribute :>> featureRepresentation :> ColRep::declaredShortName;
            attribute :>> columnWidth = 110;
        }
        view Description :> columnViews {
            attribute :>> featureRepresentation :> ColRep::specificDocumentation;
            attribute :>> defaultValue = "n/a";
            attribute :>> TableViewDefinitions::TableView::columnViews::columnWidth = 247;
        }
        :>> TableViewDefinitions::TableView::columnOrder = (Name, ID, Description);
    }
} // package DroneRequirementsViews

Reusing the same navigation

A named navigation declared once at view level and reused by three columns: one chains on to the definition typing the target, one chains on to reach one of its attributes, and one renders the target’s documentation directly.

Download Reusing the Same Navigation (ZIP)

ReusingTheSameNavigation.sysml
// Example: Reusing the Same Navigation
package DroneProject {
    part def Engine {
        attribute power;
    }
    part def ScoutMotor :> Engine;
    part def CargoMotor :> Engine;

    part def Fleet {
        part scout {
            part engine : ScoutMotor {
                attribute :>> power = 120;
                doc
                /* Lifts the scout airframe on a 4S battery. */
            }
        }
        part cargo {
            part engine : CargoMotor {
                attribute :>> power = 450;
                doc
                /* Sized for the 5 kg payload ceiling. */
            }
        }
        part trainer {
            part engine : ScoutMotor {
                attribute :>> power = 90;
                doc
                /* Detuned for pilot training flights. */
            }
        }
    }
} // package DroneProject

package DroneProjectViews {
    private import SysideViews::*;

    view enginesTable : SV::TVD::TableView {
        expose DroneProject::Fleet::*;

        engine = NamedUsage(baseViewElement, "engine", NameType::name, UsageKind::partUsage);

        view Vehicle :> columnViews {
            attribute :>> featureRepresentation :> ColRep::declaredName;
        }
        view 'Engine Type' :> columnViews {
            :>> columnFeature = DefinitionsFirst(engine);
            attribute :>> featureRepresentation :> ColRep::declaredName;
        }
        view 'Engine Power' :> columnViews {
            :>> columnFeature = NamedUsage(
                engine,
                "power",
                NameType::name,
                UsageKind::attributeUsage
            );
            attribute :>> featureRepresentation :> ColRep::featureValue;
        }
        view 'Engine Documentation' :> columnViews {
            :>> columnFeature = engine;
            attribute :>> featureRepresentation :> ColRep::specificDocumentation;
            attribute :>> TableViewDefinitions::TableView::columnViews::columnWidth = 159;
        }
        :>> TableViewDefinitions::TableView::columnOrder = (
            Vehicle, 'Engine Type', 'Engine Power', 'Engine Documentation',
        );
    }
} // package DroneProjectViews

Fanning out rows

Two chained UsageFan anchors split rows twice over: each part fans into one sub-row per port, and each port fans on into one sub-row per attribute. Cells above a fan span the sub-rows it produced, columns chain off either anchor, and a port with no attributes shows the first fan-out level applying while the second comes up empty.

Download Fanning Out Rows (ZIP)

FanningOutRows.sysml
// Example: Fanning Out Rows
package PumpStation {
    port def FluidPort {
        attribute maxPressure;
        attribute temperature;
    }
    port def DrainPort;

    part def Station {
        part pump {
            port inlet : FluidPort {
                attribute :>> maxPressure = 5.0;
                attribute :>> temperature = 65.0;
            }
            port outlet : FluidPort;
        }
        part gauge {
            port drain : DrainPort;
        }
    }
} // package PumpStation

package PumpStationViews {
    private import SysideViews::*;

    view portsTable : SV::TVD::TableView {
        expose PumpStation::Station::*;

        ports = UsageFan(baseViewElement, UsageKind::portUsage);
        portAttributes = UsageFan(ports, UsageKind::attributeUsage);

        view Part :> columnViews {
            attribute :>> featureRepresentation :> ColRep::declaredName;
        }
        view Port :> columnViews {
            :>> columnFeature = ports;
            attribute :>> featureRepresentation :> ColRep::declaredName;
        }
        view 'Max Pressure' :> columnViews {
            :>> columnFeature = NamedUsage(
                ports,
                "maxPressure",
                NameType::name,
                UsageKind::attributeUsage
            );
            attribute :>> featureRepresentation :> ColRep::featureValue;
            attribute :>> defaultValue = "(unset)";
        }
        view Attribute :> columnViews {
            :>> columnFeature = portAttributes;
            attribute :>> featureRepresentation :> ColRep::name;
        }
        view Value :> columnViews {
            :>> columnFeature = portAttributes;
            attribute :>> featureRepresentation :> ColRep::featureValue;
            attribute :>> defaultValue = "(unset)";
        }
    }
} // package PumpStationViews

Fan-out in a hierarchical table

A hierarchical table combined with a fan-out: an anchored UsageFan splits each definition row into one sub-row per attribute, shared by an attribute-name and an attribute-value column. A fanned tree row becomes several sub-rows at the same tree position, with the node’s children hanging off the last of them.

Download Hierarchical Fan-Out (ZIP)

FanOutInAHierarchicalTable.sysml
// Example: Fan-Out in a Hierarchical Table
package Transmission {
    part def Shaft {
        attribute diameter = 32.0;
        attribute length = 480.0;
    }
    part def Gearbox {
        attribute ratio = 3.2;
        attribute mass = 12.5;
        part output : Shaft;
    }
    part def Driveline {
        part gearbox : Gearbox;
    }
}

package TransmissionViews {
    private import SysideViews::*;

    view drivelineAttributes : SV::TVD::HierarchicalTableView {
        expose Transmission::Driveline;
        attribute :>> defaultCollapse = false;

        attrs = UsageFan(baseViewElement, UsageKind::attributeUsage);

        view Definition :>> hierarchicalColumn {
            attribute :>> featureRepresentation :> ColRep::declaredName;
        }
        view Attribute :> columnViews {
            :>> columnFeature = attrs;
            attribute :>> featureRepresentation :> ColRep::declaredName;
        }
        view Value :> columnViews {
            :>> columnFeature = attrs;
            attribute :>> featureRepresentation :> ColRep::featureValue;
        }
    }
}

Accessing hierarchy usages

A hierarchical table navigating between each row’s definition and the usage the tree reached it through. The tree column is redefined with UsageHTV to label rows by usage, which tells apart two rows typed by the same definition, and Owner(UsageHTV(baseViewElement)) chains onwards from that usage to name each row’s tree parent.

Download Accessing Hierarchy Usages (ZIP)

AccessingHierarchyUsages.sysml
// Example: Accessing Hierarchy Usages
package Drivetrain {
    part def Piston;
    part def Cylinder {
        part piston : Piston;
    }
    part def Engine {
        part cyl : Cylinder;
    }
    part def Motor;
    part def Hybrid {
        part combustion : Engine;
        part frontDrive : Motor;
        part rearDrive : Motor;
    }
}

package DrivetrainViews {
    private import SysideViews::*;

    view drivetrainTree : SV::TVD::HierarchicalTableView {
        expose Drivetrain::Hybrid;
        attribute :>> defaultCollapse = false;

        view Usage :>> hierarchicalColumn {
            :>> columnFeature = UsageHTV(baseViewElement);
        }
        view Definition :> columnViews {
            attribute :>> featureRepresentation :> ColRep::declaredName;
        }
        view 'Used In' :> columnViews {
            :>> columnFeature = Owner(UsageHTV(baseViewElement));
            attribute :>> featureRepresentation :> ColRep::name;
        }
    }
}

All examples in one download

Every example on this page in a single archive, one folder per example:

Download All Table View Examples (ZIP)