Package Diagrams

Package diagrams describe the relationships between packages in a model. You can use a package diagram to organize objects in a complex project.

To create a package diagram, click the Create New Model command in the homepage Quick Links card (see Creating a Model), enter a name, select Object-Oriented Model in the Type list and SysML Package Diagram in the Template list, and click Create.

In this example, Package A contains two child packages, A1 and A2. There are two alternative ways to display package hierarchy in the diagram, sub-symbols view and tree view. By default, child packages are shown as sub-symbols inside the parent package.

Sub-Symbols View (Default)

Tree View

To create a child package, drag the Package tool from the toolbox and drop it inside the symbol of the parent package.

Alternatively, choose the parent symbol and click the Add Child Package tool on it.

To create a child package, drag the Package tool from the toolbox, drop it onto your diagram, and then put it inside the symbol of the parent package.

Alternatively, choose the parent symbol and click the Add Child Package tool on it.

To show all child packages of a parent package, select the parent symbol, choose Start of the navigation pathSettings Next navigation step Show All ChildrenEnd of the navigation path.

To show or hide all child package of a parent package, click the + or - symbol on the bottom of the package symbol.

To switch between package hierarchy views, choose Start of the navigation pathMenu Next navigation step Display Package Hierarchy as TreeEnd of the navigation path or Display Package Hierarchy as Sub-Symbols.

The following tools are available in package diagrams:

Tools

Description

Reuse Model Objects. Opens a list to allow you to drag existing model objects into the diagram.

Package. See Packages.

Note. Add notes to your diagram and link them to your symbols.

Generalization - An object is a specialization of another object.

Import and Merge. You can create the following types of dependency:
  • Import (default) - Represents that contents of a package will be imported into another package. For example, package Value Types for HybridSUV System imports the contents in the Reusable Value Types package.

    Click the Import tool to select it, and then click and drag from the package Value Types for HybridSUV System to the package Reusable Value Types.

  • Merge – Represents that contents of a package will combine with contents of another package. For example, package Employee Locations (containing data of employee IDs and associated locations) will be merged into package Employees Info (containing data of employee IDs and associated employee names), resulting in a package containing data of employee IDs, names, and locations.

    Click the Import tool to select it, and then click and drag from the package Employees Info to the package Employee Locations. Select the Change Link Type tool to change the link type to Merge.

  • Dependency - A package has a dependency on another package. For example, a package containing Electric Vehicle data depends on the package containing Charging Station data.

    Click the Import tool to select it, and then click and drag from the package Electric Vehicle to the package Charging Station. Select the Change Link Type tool to change the link type to Dependency.

Link – Provides an alternative way to create a link. Select the tool and connect two objects with a default link, then choose Change Link Type to change to another link as appropriate.

This tool is available in both the diagram toolbox and in the context menu of the relevant objects.

Lasso. Select multiple symbols by dragging over them.