UML Modeling Techniques > Instance modeling > Object diagram > Creating nested instances on an object diagram
  
Creating nested instances on an object diagram
A nested Instance can be created only when the nested Instance's classifier is a part of the nesting Instance's classifier. For more information, see Overview of instance modeling.
For information about creating nested Instances in the Packages pane, see Creating a nested instance in the packages pane.
To automatically create nested instances for an instance's classifier's parts:
1. On the Object Diagram, right-click the Instance for which you want to create nested Instances, point to Populate, and then click Create Instances of Parts.
Modeler creates any nested Instances that are required to model the Instance's classifier's Parts.
2. Rename each of the nested Instances as required.
3. For each Instance, set the Slot Values of the Instance's Slots as required. For more information, see Setting a text value or linked values of a slot.
To create a nested instance for an instance's classifier's part:
1. On the Object Diagram, create the Instance using the appropriate type. For more information, see Creating an instance on an object diagram.
2. On the Object Diagram toolbar, click the Link button.
3. Click the nesting Instance, and then click the nested Instance you created.
Modeler makes the Instance you created into a nested Instance, assuming that the Instance's classifier is valid.
4. If you want to show the nesting through containment, drag the nested Instance on to the nesting Instance.
5. For each Instance, set the Slot Values of the Instance's Slots as required. For more information, see Setting a text value or linked values of a slot.