On this page

You can create several different sets of instances using the Automatic Instantiation wizard. You can add each set to a different package and display it on a newly created diagram. 

Depending on the size of your system, a very large number of instance specifications can be created using the wizard. That is why we strongly recommend selecting a new package wherein all created instance specifications will be stored. 

Step #1. Selecting parts to be instantiated

In this step, you can see all the available instance specification values (parts) of your selected element. At this point, you can select which parts or properties to instantiate, create or select values for parts and properties, as well as add or remove parallel parts.

You can select/deselect the parts by clicking the check marks next to the parts or the options in the Selection area.

Parts are displayed if the multiplicity is greater than 1. The number of parts displayed depends on the multiplicity.

  • If the multiplicity is a particular value, for example 2, then you will see 2 parts displayed in the Automatic Instantiation wizard. Also, in this case, you will not be able to add parallel parts or remove existing parallel parts.
  • If the multiplicity is defined as an interval (for example, 0..*, 1..10, 1..* ) or *, only one part will be created by default. If you need more parts, you can create them by pressing Insert or selecting Add parallel part from the selected property’s shortcut menu. 
  • If the multiplicity is 1, parts will not be created.

The parts and properties are displayed with the suggested types, names, and values. In this step of the wizard, you can change them.  You can also change the type for the part only if there is an available sub-element for that part in your model (see the Case study).


Selecting a value for an instance

To select a value for an instance


  1. Select a part to be instantiated to which you want to add a value. 
  2. In Instantiated properties, click a Value specification cell and then click the ... button.
  3. The Select Instance Specification dialog opens.
  4. In the opened dialog, select the instance specification you want to add for the selected instance.
  5. Click the OK button. 


To create a value for an instance


  1. Select a part to be instantiated for which you want to create a value.
  2. In Instantiated properties, click the Value specification cell and then click the Show Shortcut Menu button. 

  3. In the opened shortcut menu, point to the Value Specification and then select one of the available value types.
  4. In the Value property specification cell, type the desired value.


Changing the name of an instance

Each instance has a default name that uses the dot notation. However, you can change the default name by clicking the value row next to the Name property and typing the new name for the instance.   


Applying a custom stereotype to an instance

You can also apply the custom stereotype to the instance. Only those stereotypes can be applied that have  Instance Specification as their metaclass and whose customizations have a meta property named classifier with the  New Types property value set to the instantiated element’s type.

The custom «ControllerFMU» and «ControllerSTM» stereotypes have Instance Specification as their metaclass
and their respective customizations ControllerFMU Customization and ControllerSTM Customization have a meta property named classifier with the New Types property value set to the «Controller» stereotype.
Since the Controller class has the «Controller» stereotype applied, the «ControllerFMU» and «ControllerSTM» stereotypes can be applied to the Controller class's instance.

Changing a type for an instance

You can change the type for the property's instance only if that type is a subtype of a Class (connected through Generalization). As shown in the following figure, the Engine GM Class and Engine GMR Class are subtypes of the Engine Class. When creating an instance for the Vehicle Class, you can change the type of the engine Property by selecting one of the following: Engine GM  Class, Engine GMR  Class, or Engine Class.

Changing the type for a Part Property instance directly in the Automatic Instantiation dialog.

Step #2. Selecting a package

In this step, you can select the package to store instance specifications. You can select an existing package from the element tree, create a new package, or clone selected packages. Click the Finish button after this step if you do not want to display your created instance specifications.


To create a new Package in the element tree


  1. In the element tree, select the Package for which you want to create the new one.
  2. Click the Creation Mode button. 
  3. Click the Create Owner button.
  4. From the open menu, select the package kind. The Specification window of that package opens.
  5. Type its name.
  6. Click Close.


To clone the Packages in the element tree


  1. In the element tree, select the Package to clone.

    The Package is cloned recursively including all nested structures.
  2. Click the Clone button.
  3. The Specification window of cloned Package opens.
  4. Type its name.
  5. Click Close.

Step #3. Creating a diagram (optional)

In this step, you can choose whether you want to show your created instance specifications in a new diagram or not. If you do not wish to create a new diagram, you can simply skip this step.


To create a diagram using Automatic Instantiation Wizard


  1. If you choose to create a new diagram for displaying instance specification(s), select the Create a new diagram check box
  2. If you wish to create and display links between your instance specification(s), select the  Create link between instances check box.
  3. Fill in the  Type diagram name field by typing the diagram name.

    Note

    By default, the diagram name is the selected Package's name in Step 2.

  4. From the Select diagram type drop-down list, you can select one of the diagram types.
  5. Specify the owner for a new diagram:
    • Select existing Packages from the tree.
    • Click the Create Owner button to create a new one.
    • Click the Clone button to clone existing Packages.
  6. After clicking the Finish button, a new diagram with instance specifications is created and displayed in your project.