To better understand the usability of the smart packages, please see the following case studies.
The case study uses the sample project use case diagram.mdzip, which can be found in <MagicDraw installation folder>\samples\diagrams. |
For example, we have a lot of use cases owned by different system boundaries in the project.
We need all these use cases to be in a single package, except for several particular ones. Also, we need all newly created use cases to be automatically included into this package.
In this case, the smart packages feature is very useful. We will create a smart package with dynamic contents to gather all use cases in the model, then demonstrate how it manages further changes in the model. Finally, we will create a snapshot of the smart package to have a static list of use cases as a milestone of the model development.
To accomplish this, do the following:
The case study uses the sample project hybrid sport utility vehicle.mdzip, which can be found in <MagicDraw installation folder>\samples\SysML, if the SysML plugin is installed. |
Here is another case where the smart package feature is very helpful: we need to have all unsatisfied requirements in a separate package. Also, we need requirements to automatically disappear from this package after becoming satisfied.
We will create a smart package with dynamic contents to gather all the unsatisfied requirements in the model and a dependency matrix for performing the requirements coverage analysis. Then we will demonstrate how both the smart package and the dependency matrix reflect the transition of a requirement to satisfy.
Let’s do the following:
To gather the contents of the smart package, add a new script operation (in the Expert mode of the Query dialog) and define the following OCL 2.0 expression as the criteria:
SysML::Requirements::Requirement::allInstances()->select(r|not r.supplierDependency->exists(d|d.oclIsKindOf(SysML::Satisfy))) |
The efficient configuration management process is a challenge in the evolution of any industrial scale product family. Smart packages are a real-life out of the box solution supporting the configuration management approach.
Now study the case that illustrates the efficient management of the complex system configurations with the help of smart packages. We have a library (static package) of system components, which we need to see in several different views of the model, that is, catalogs, according to their characteristics. Using the catalogs will not extend the scope of the model, since they do not require duplication of the elements.
We will create two dynamic system configuration catalogs, that is, smart packages with dynamic contents, to gather the servers from the library TI Hardware according to the configuration version defined in a tag value of their specification.
Do the following:
Expand the contents of both smart packages.
The block SUN FIRE T1000 appears in both TI12 Catalog and TI14 Catalog, since it has both tag values Used In=TI12 and Used In=TI14. |
Also, you can add a block to a smart package manually. Just drag the block to the smart package.