Creating Package Diagrams
What if we had to share what our model organization was to a manager who doesn’t understand MBSE? Or maybe we want to quickly bring new modeling team members up to speed with how we structured our model? Creating Package Diagrams can help us out in both these use cases.
What is A Package Diagram?
A package diagram is used to graphically represent the containment structure of a system model. As we create packages, we are also creating containment relationships. These relationships show what element is contained is within another model element. Think of a nested folder structure and that’s essentially containment!
Let’s Create A Package Diagram
We will right-click on the ‘Model’ element, Create Diagram, and search for ‘Package Diagram’. Since we’re using SysML, we’ll pick the ‘SysML Package Diagram’.
Here’s another way to create Packages. We will click on ‘Package’ in the diagram tool bar and a nameless package appears in our containment tree.
Ok I’ll delete this now but to delete it permanently, I will have to delete it within the containment tree. This applies to any model element that must be removed permanently.
Ok! Back to creating a Package Diagram.
We will drag the ‘Structure’ Package from our containment tree onto our diagram.
To see the containment relationships, we will right click and select ‘Display Related Elements’. We’ll get a window here and let’s select ‘Containment Relationships’.
MagicDraw/Cameo gives the option of showing either ‘Incoming’, ‘Outgoing’ or ‘Both’. We’ll select ‘Both’ and the related packages will appear on our diagram.
Connecting these packages are the containment relationships drawn in the hierarchy of how our packages are nested.
But if we have a lot of packages in our model, a node-to-node representation of our package containment can get a little messy.
Fortunately, we have another option with the use of embedded representation. We can do this by right-clicking the package, and select ‘Displaying Inner Elements’.
There! Now we can see all the packages within the Structure Package.
Ok! So we will use the embedded representation for our package diagram. Let’s select each of these packages and drag them onto our diagram. And we’ll show the inner elements for each.
Keep in mind that there are plenty of ways of building a package diagram like this. It usually depends on who your stakeholders are and for what purpose they are using a diagram like this for.