The following sections outline how to manage the smart package's contents once it is created.
Including elements into a smart package
An element can be included in the smart package in one of two ways:
- Manually - the user selects to include the particular element. Manually included elements constitute the static contents.
- Automatically - the element meets the set of criteria defined by the user. Automatically included elements constitute the dynamic contents.
The membership in the smart package is not the UML ownership association. The owner of the element will not change after the element is included in the smart package.
To include an element into a smart package manually
Do either:
In the Containment tree, select an element and drag it to the smart package.
See the element included into the contents of the smart package. The element becomes a value of the Additional Elements property as well.You can include more than one element at once.
- To include adjacent elements, select a single element, and then hold down the Shift key while you click any other elements you want to add.
- To include nonadjacent elements, select a single element, and then hold down the Ctrl key while you click any other elements you want to add.
- Open the Specification window of the smart package and click the cell of the Additional Elements property value. Then click and in the open dialog, select one or more elements. Click OK when you are done. See the element(s) included in the contents of the smart package.
To include elements into a smart package automatically
- Open the Specification window of the smart package.
- Under the Content category, click the cell of the Query property value.
- Click . The Query dialog opens.
In the dialog, define a set of criteria (query) for gathering the elements into the contents of the smart package.
For instructions about defining criteria in the Query dialog, refer to Specifying Criteria for Querying Model.
You can select to show implied relationships (logical relationships calculated from inherited or inner elements of the model element) to provide additional information.
Close the Specification window. See the contents of the smart package updated with elements that meet the defined set of criteria.
If the contents of the smart package are not updated, select View > Refresh from the main menu.
- If the smart package contains manually included elements (values of the Additional Elements property), they are joined with the automatically included elements, skipping duplicates.
- If the smart package has excluded elements (values of the Excluded Elements property), they do not appear in the dynamic contents of the smart package.
Removing elements from a smart package
To remove an element from a smart package
Do either:
In the Containment tree, under the smart package, right-click the element. From the shortcut menu, select Delete from Contents or press Delete.
You can exclude more than one element at once.
- To exclude adjacent elements, select a single element, and hold down the Shift key while you click other elements you want to exclude.
- To exclude nonadjacent elements, select a single element, and hold down the Ctrl key while you click other elements that you want to exclude.
- Open the Specification window of the smart package and click the cell of the Excluded Elements property value. Then click and in the open dialog, select one or more elements. Click OK when you are done.
Open the Specification window of the smart package and click the cell of the Additional Elements property value. Then click and in the open dialog, unselect one or more elements. Click OK when you are done.
This is only valid for manually added elements.
See the element removed from the contents of the smart package, though it is not removed from the model. You can still see the element displayed under the owner of the element in the Containment tree.
Freezing the contents of a smart package
If you do not want the contents of the Smart Package to be updated automatically, you can suspend the calculation of the Smart Package contents. As a result, elements gathered according to a set of criteria specified in the Query dialog are no longer automatically added to the Smart Package contents. You can undo this at any time by changing the Frozen state.
The Specification window of the Smart Package with the suspended contents.
To freeze the contents of a Smart Package
In the Containment tree, right-click the Smart Package with the dynamic contents and from the shortcut menu select Frozen.
The contents of the smart package will no longer be automatically updated after the relevant changes are made in the model.
You can update the contents of the Smart Package on demand without the need to change the Frozen state to disabled by performing the Refresh Contents action.
To refresh the contents of a Smart Package on demand
- In the Containment tree, right-click the Smart Package with the dynamic contents and from the shortcut menu select Refresh Contents.
The contents of the Smart Package is successfully refreshed.
Making a snapshot of the smart package
You can create a copy of the smart package with the static contents, that is, a snapshot.
To make a snapshot of a smart package
- In the Containment tree, right-click the smart package with dynamic contents and from the shortcut menu select Snapshot Contents. The element Selection dialog opens.
- In the dialog, select an owner of the new smart package and click OK.
See the new smart package created under the selected owner in the Containment tree with the name Snapshot of <smart package name>, for example, Snapshot of My Bookmarks. The contents of the snapshot equal the contents of the smart package, but the list of elements is static.